From 2990b481521b8b4c8577954836b4008f863c386b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 12:50:17 -0300 Subject: [PATCH 1/6] Try only pytest 3.0 --- .github/workflows/main.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index c3d3864e..0192a42a 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -14,17 +14,17 @@ jobs: os: [ubuntu-latest, windows-latest] include: - python: "2.7" - tox_env: "py27-pytest31" + tox_env: "py27-pytest30" - python: "3.5" - tox_env: "py35-pytest31" + tox_env: "py35-pytest30" - python: "3.6" - tox_env: "py36-pytest31" + tox_env: "py36-pytest30" - python: "3.7" - tox_env: "py37-pytest31" + tox_env: "py37-pytest30" - python: "3.8" - tox_env: "py38-pytest31" + tox_env: "py38-pytest30" - python: "pypy3" - tox_env: "pypy3-pytest31" + tox_env: "pypy3-pytest30" steps: - uses: actions/checkout@v1 From 9d2c3c49ed765b452a7201cecb5146707642899e Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 12:50:40 -0300 Subject: [PATCH 2/6] Remove Travis and AppVeyor configs --- .appveyor.yml | 29 ---------------------- .travis.yml | 68 --------------------------------------------------- 2 files changed, 97 deletions(-) delete mode 100644 .appveyor.yml delete mode 100644 .travis.yml diff --git a/.appveyor.yml b/.appveyor.yml deleted file mode 100644 index ecb64593..00000000 --- a/.appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -environment: - matrix: - # note: please use "tox --listenvs" to populate the build matrix below - - TOXENV: "py27-pytest29" - - TOXENV: "py27-pytest30" - - TOXENV: "py27-pytest31" - - TOXENV: "py35-pytest29" - - TOXENV: "py35-pytest30" - - TOXENV: "py35-pytest31" - - TOXENV: "py36-pytest29" - - TOXENV: "py36-pytest30" - - TOXENV: "py36-pytest31" - - TOXENV: "py37-pytest30" - - TOXENV: "py37-pytest31" - -install: - - echo Installed Pythons - - dir c:\Python* - - - C:\Python37\python -m pip install --upgrade --pre tox - -build: false # Not a C# project, build stuff at the test step instead. - -test_script: - - C:\Python37\python -m tox - -# We don't deploy anything on tags with AppVeyor, we use Travis instead, so we -# might as well save resources -skip_tags: true diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 25fb8ca3..00000000 --- a/.travis.yml +++ /dev/null @@ -1,68 +0,0 @@ -dist: xenial -language: python - -python: - - '2.7' - - '3.5' - - '3.6' - - '3.7' - # - 'pypy' - - 'pypy3' - -env: - global: - - COVERAGE_PROCESS_START=$PWD/tox.ini - matrix: - - DEPS="pytest~=2.9.0" - - DEPS="pytest~=3.0.0" - #- DEPS="pytest~=3.1.0" - -stages: - - name: test - if: tag IS NOT present - - name: deploy - if: repo = pytest-dev/py AND tag IS present - -matrix: - include: - - python: '2.7' - # using a different option due to pytest-addopts pytester issues - env: PYTEST_XADDOPTS="-n auto --runslowtests" DEPS="pytest~=3.0.0 pytest-xdist<1.25 pytest-forked<0.3" - - - stage: deploy - python: '3.6' - env: - install: pip install -U setuptools setuptools_scm - script: skip - deploy: - provider: pypi - user: nicoddemus - distributions: sdist bdist_wheel - skip_upload_docs: true - password: - secure: VNYW/sZoD+9DzKCe6vANNXXJR7jP7rwySafQ33N1jAnCrdylQjEN/p6tSfUe8jDi3wDpLPL9h8pwfxuUT7CRxglHov3Qe7zSeywixvHan5aFahQiQ8+gucYIM7wITHH3oQs7jN35pnhdnF+QlW2+eDCL6qOLU5XwuRhsDKXjQ/hUWR5hlX5EniD1gzyKEf6j1YCpST87tKpeLwVEYEmsucdkUZuXhxDtyaWQHWiPsLWwh/slQtUJEHeLF26r8UxFy0RiGne9jR+CzRfH5ktcA9/pArvp4VuwOii+1TDxVSYP7+I8Z+eUKN9JBg12QLaHwoIN/8J+MvHCkuf+OGSLM3sEyNRJGDev372xg3K7ylIkeeK4WXirKEp2ojgN8tniloDjnwdu/gPWBnrXuooA60tNoByHFa8KbMZAr2B2sQeMxD4VZGr1N8l0rX4gRTrwvdk3i3ulLKVSwkXaGn+GrfZTTboa7dEnpuma8tv1niNCSpStYIy7atS8129+5ijV3OC8DzOMh/rVbO9WsDb/RPG3yjFiDvEJPIPeE0l/m5u42QBqtdZSS2ia7UWTJBiEY09uFMTRmH5hhE/1aiYBbvAztf5CReUbeKdSQz3L8TTSZqewtFZmXTkX97/xQnrEpsnGezIM2DNuMEuQG3MxGkNCxwbQKpx/bkHdrD75yMk= - on: - tags: true - repo: pytest-dev/py - - exclude: - - python: '3.7' - env: DEPS="pytest~=2.9.0" - - allow_failures: - - python: 'pypy' - - python: 'pypy3' - -install: - - pip install -U coverage coverage-enable-subprocess pip setuptools setuptools_scm - - pip install $DEPS - - pip install -U . --force-reinstall - -script: - - coverage run -m pytest --lsof $PYTEST_XADDOPTS - -after_success: - - coverage combine - - coverage report -m - - coverage xml - - bash <(curl -s https://codecov.io/bash) -Z -X gcov -X coveragepy -X search -X xcode -X gcovout -X fix -f coverage.xml -e TRAVIS_PYTHON_VERSION From 4a694b00a68de2d93b547c2704da4283a375a53c Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 12:51:49 -0300 Subject: [PATCH 3/6] Add GitHub Actions badge to README --- README.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 7eb534f3..5b56764e 100644 --- a/README.rst +++ b/README.rst @@ -7,11 +7,8 @@ .. image:: https://img.shields.io/pypi/pyversions/pytest.svg :target: https://pypi.org/project/py -.. image:: https://img.shields.io/travis/pytest-dev/py.svg - :target: https://travis-ci.org/pytest-dev/py - -.. image:: https://ci.appveyor.com/api/projects/status/10keglan6uqwj5al/branch/master?svg=true - :target: https://ci.appveyor.com/project/pytestbot/py +.. image:: https://github.com/pytest-dev/py/workflows/build/badge.svg + :target: https://github.com/pytest-dev/py/actions **NOTE**: this library is in **maintenance mode** and should not be used in new code. From fef9a32a8578e9c467f6ef8ccc7bce81b89496a4 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 12:55:56 -0300 Subject: [PATCH 4/6] Adapt test --- testing/code/test_source.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index 3492761a..caba34b8 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -103,7 +103,7 @@ def test_source_strip_multiline(): def test_syntaxerror_rerepresentation(): ex = py.test.raises(SyntaxError, py.code.compile, 'xyz xyz') assert ex.value.lineno == 1 - assert ex.value.offset in (4,7) # XXX pypy/jython versus cpython? + assert ex.value.offset in (5, 7) # pypy/cpython difference assert ex.value.text.strip(), 'x x' def test_isparseable(): From e94e670032d8ccf42ad9d37730bd03b6da6f263b Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 13:29:37 -0300 Subject: [PATCH 5/6] Fix test_comments() in test_source Copied the test as fixed in pytest's repo. --- testing/code/test_source.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/testing/code/test_source.py b/testing/code/test_source.py index caba34b8..08fc733c 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -510,11 +510,17 @@ def test_comments(): comment 4 """ ''' - for line in range(2,6): - assert str(getstatement(line, source)) == ' x = 1' - for line in range(6,10): - assert str(getstatement(line, source)) == ' assert False' - assert str(getstatement(10, source)) == '"""' + for line in range(2, 6): + assert str(getstatement(line, source)) == " x = 1" + if sys.version_info >= (3, 8) or hasattr(sys, "pypy_version_info"): + tqs_start = 8 + else: + tqs_start = 10 + assert str(getstatement(10, source)) == '"""' + for line in range(6, tqs_start): + assert str(getstatement(line, source)) == " assert False" + for line in range(tqs_start, 10): + assert str(getstatement(line, source)) == '"""\ncomment 4\n"""' def test_comment_in_statement(): source = '''test(foo=1, From 887d6b8937bd74c729c89b589ec8adaa557a78cf Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Fri, 11 Dec 2020 13:55:48 -0300 Subject: [PATCH 6/6] Skip test_samefile_symlink on pypy3 on Windows --- testing/path/test_local.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/testing/path/test_local.py b/testing/path/test_local.py index a6b8f476..1b9a7923 100644 --- a/testing/path/test_local.py +++ b/testing/path/test_local.py @@ -721,8 +721,9 @@ def test_samefile_symlink(tmpdir): p2 = tmpdir.join("linked.txt") try: os.symlink(str(p1), str(p2)) - except OSError as e: + except (OSError, NotImplementedError) as e: # on Windows this might fail if the user doesn't have special symlink permissions + # pypy3 on Windows doesn't implement os.symlink and raises NotImplementedError pytest.skip(str(e.args[0])) assert p1.samefile(p2)