Page MenuHomePhabricator

AppVeyor and some Travis environments warn that "setup.py test" is deprecated
Closed, ResolvedPublic

Description

...and will be removed in the future: https://travis-ci.org/wikimedia/pywikibot/jobs/639814475

This happens because AppVeyor and zh:wikisource Travis environments set PYSETUP_TEST_EXTRAS=1, which sets USE_PYTEST=0, therefore setup.py test is used instead of setup.py pytest: https://phabricator.wikimedia.org/diffusion/PWBC/browse/master/.travis.yml$32

Event Timeline

Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald Transcript
Dvorapa updated the task description. (Show Details)
Dvorapa renamed this task from AppVeyor throws warning "setup.py test" is deprecated to AppVeyor throws warning "coverage run setup.py test" is deprecated.Jan 20 2020, 5:12 PM
Dvorapa updated the task description. (Show Details)
Dvorapa updated the task description. (Show Details)
Dvorapa renamed this task from AppVeyor throws warning "coverage run setup.py test" is deprecated to AppVeyor and some Travis environments warn that "setup.py test" is deprecated.Jan 21 2020, 10:25 AM
Dvorapa triaged this task as High priority.
Dvorapa updated the task description. (Show Details)
Dvorapa renamed this task from AppVeyor and some Travis environments warn that "setup.py test" is deprecated to AppVeyor and some Travis environments warn that "setup.py test" is deprecated and fail.Jan 21 2020, 10:29 AM
Dvorapa updated the task description. (Show Details)
Dvorapa renamed this task from AppVeyor and some Travis environments warn that "setup.py test" is deprecated and fail to AppVeyor and some Travis environments warn that "setup.py test" is deprecated (and fail?).Jan 21 2020, 10:37 AM
Dvorapa updated the task description. (Show Details)
Dvorapa lowered the priority of this task from High to Medium.Jan 25 2020, 12:16 PM

Okay, python -m unittest -vv could work, but we need to fix discovery somehow, because setup.py test runs 1800 tests, while -m unittest -vv runs 1799.

It seems moving setup.py discover to tests/__init__.py load-tests should do (https://docs.python.org/3/library/unittest.html#load-tests-protocol)

Change 569360 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [tests] setup.py test is being deprecated

https://gerrit.wikimedia.org/r/569360

Change 569360 merged by jenkins-bot:
[pywikibot/core@master] [tests] setup.py test is being deprecated

https://gerrit.wikimedia.org/r/569360

Xqt claimed this task.

Python 2.7 build at Appveyor ran 0 tests:

Executing: coverage run -m unittest -vv

----------------------------------------------------------------------
Ran 0 tests in 0.000s

OK
Coverage.py warning: No data was collected. (no-data-collected)
Collecting artifacts...
No artifacts found matching 'dist\*  .coverage coverage.xml' path
codecov
The filename, directory name, or volume label syntax is incorrect.
FIND: Parameter format not correct

I think there is some directory issue. I thought setup.py file is in the same directory as tests/ folder.

Xqt removed Xqt as the assignee of this task.Feb 2 2020, 4:57 PM

I think there is some directory issue. I thought setup.py file is in the same directory as tests/ folder.

Looks like Python 2 problem (at Appveor)

Dvorapa renamed this task from AppVeyor and some Travis environments warn that "setup.py test" is deprecated (and fail?) to AppVeyor and some Travis environments warn that "setup.py test" is deprecated.Feb 28 2020, 8:18 PM
Dvorapa updated the task description. (Show Details)
Dvorapa moved this task from Needs Review to Waiting on other changes on the Pywikibot board.
Xqt lowered the priority of this task from Medium to Lowest.Mar 10 2020, 10:53 AM
Dvorapa raised the priority of this task from Lowest to Medium.Mar 10 2020, 11:38 AM

Well, this will need to be fixed right after Python 2 will be dropped

Change 569362 had a related patch set uploaded (by Dvorapa; owner: Dvorapa):
[pywikibot/core@master] [tests] setup.py test is being deprecated

https://gerrit.wikimedia.org/r/569362

I solved the issues. unittest has simply a dumb/broken discovery in Python 2, so you need to help it with -p "*_tests.py" param

Change 569362 merged by jenkins-bot:
[pywikibot/core@master] [tests] setup.py test is being deprecated

https://gerrit.wikimedia.org/r/569362

Dvorapa claimed this task.
Dvorapa raised the priority of this task from Medium to High.
Dvorapa moved this task from Backlog to Framework on the Pywikibot-tests board.
Dvorapa removed a project: Patch-For-Review.
Dvorapa moved this task from Waiting on other changes to Backlog on the Pywikibot board.