From fb5733b8b9fcbbce65f45811aa8701d19fc1cbe2 Mon Sep 17 00:00:00 2001 From: Nathan Stocks Date: Sun, 1 Nov 2020 22:45:43 -0700 Subject: [PATCH] First attempt at fixing Windows CI on GitHub Actions (#237) * First attempt at fixing Windows CI on GitHub Actions * Don't use appveyor-style env vars and executable extensions * Remove python-2-specific test that's breaking in GitHub actions (we don't support Python 2 any more) --- .github/workflows/ci-windows.yml | 31 +++++++++++++++++++++++++++++++ .github/workflows/ci.yml | 2 +- green/test/test_result.py | 19 ------------------- 3 files changed, 32 insertions(+), 20 deletions(-) create mode 100644 .github/workflows/ci-windows.yml diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 0000000..92f2150 --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,31 @@ +name: Windows CI + +on: + push: + branches: [master] + pull_request: + branches: [master] + +jobs: + tests: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [windows-latest] + python-version: [3.6, 3.7, 3.8] + + steps: + - uses: actions/checkout@v2 + + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements-optional.txt + + - name: Test + run: python -m green.cmdline -vvv -t green -s 1 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6960e00..15011c6 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,7 +11,7 @@ jobs: runs-on: ${{ matrix.os }} strategy: matrix: - os: [macos-latest, windows-latest, ubuntu-latest] + os: [macos-latest, ubuntu-latest] # Windows is handled in ci-windows.yml python-version: [3.6, 3.7, 3.8] steps: diff --git a/green/test/test_result.py b/green/test/test_result.py index 2c309c2..d804b44 100644 --- a/green/test/test_result.py +++ b/green/test/test_result.py @@ -723,25 +723,6 @@ def test_printErrorsVerbose4(self): self.assertIn("raise Exception", self.stream.getvalue()) self.assertIn("Error", self.stream.getvalue()) - def test_printErrors_Py2Unicode(self): - """ - printErrors() doesn't crash in Python 2 when tracebacks contain unicode - """ - try: - raise Exception("Das Böse ist immer und überall") - except: - err = sys.exc_info() - self.args.verbose = 1 - self.args.termcolor = False - gtr = GreenTestResult(self.args, GreenStream(self.stream)) - gtr.addError(MyProtoTest(), proto_error(err)) - gtr.printErrors() # We shouldn't hit an exception here - self.assertIn("\n\n", self.stream.getvalue()) - self.assertIn("my_module.MyClass.myMethod", self.stream.getvalue()) - self.assertIn("raise Exception", self.stream.getvalue()) - self.assertIn("Error", self.stream.getvalue()) - self.assertIn("Böse", self.stream.getvalue()) - def test_addProtoTestResult(self): """ addProtoTestResult adds the correct things to the correct places.