diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0439226..bf88b4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -26,13 +26,15 @@ jobs: uses: actions/cache@v1 id: cache with: - path: .cache/pip + path: | + .cache/pip + eggs key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt', 'constraints.txt', 'buildout.cfg', 'setup.*') }} restore-keys: | ${{ runner.os }}-test - name: Install dependencies run: | - pip install -U pip + pip install --user -U pip pip install -r requirements.txt -c constraints.txt buildout - name: Run Tests diff --git a/src/z3c/jbot/tests/test_doctests.py b/src/z3c/jbot/tests/test_doctests.py index b100935..6b334f4 100644 --- a/src/z3c/jbot/tests/test_doctests.py +++ b/src/z3c/jbot/tests/test_doctests.py @@ -10,19 +10,28 @@ from .common import setUp from .common import tearDown -OPTIONFLAGS = (doctest.ELLIPSIS | - doctest.NORMALIZE_WHITESPACE) +OPTIONFLAGS = ( + doctest.ELLIPSIS | doctest.NORMALIZE_WHITESPACE +) class Py23DocChecker(doctest.OutputChecker): def check_output(self, want, got, optionflags): + # fix windows line-endings to match ones in tests + got = got.replace(r"\r\n", r"\n") + # fix binary/unicode differences between python versions if six.PY2: want = re.sub("b'(.*?)'", "'\\1'", want) else: want = re.sub("u'(.*?)'", "'\\1'", want) - want = want.replace(r"\r\n", r"\n") return doctest.OutputChecker.check_output(self, want, got, optionflags) + def output_difference(self, example, got, optionflags): + # fix windows line-endings to match ones in tests + got = got.replace(r"\r\n", r"\n") + return doctest.OutputChecker.output_difference( + self, example, got, optionflags) + def test_suite(): globs = dict(