mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
tests: Remove 'tests/run.py'
This is no longer necessary. One test needs to be modified to deal with how 'python -m pytest' modifies the PATH. Signed-off-by: Stephen Finucane <stephen@that.guru>
This commit is contained in:
parent
529c96a3c9
commit
7c0723fd46
@ -39,7 +39,7 @@ test_script:
|
|||||||
if (-not $test_ignore) { $test_ignore = '' }
|
if (-not $test_ignore) { $test_ignore = '' }
|
||||||
$tests = $env:TEST
|
$tests = $env:TEST
|
||||||
if (-not $tests) { $tests = '' }
|
if (-not $tests) { $tests = '' }
|
||||||
& "C:\Python$($env:PYTHON)\python.exe" run.py $test_ignore.Split(' ') --junitxml .junit.xml $tests.Split(' ')
|
& "C:\Python$($env:PYTHON)\python.exe" -m pytest $test_ignore.Split(' ') --junitxml .junit.xml $tests.Split(' ')
|
||||||
Pop-Location
|
Pop-Location
|
||||||
if ($LastExitCode -eq 1) { Write-Host "Test Failures Occurred, leaving for test result parsing" }
|
if ($LastExitCode -eq 1) { Write-Host "Test Failures Occurred, leaving for test result parsing" }
|
||||||
elseif ($LastExitCode -ne 0) { Write-Host "Other Error Occurred, aborting"; exit $LastExitCode }
|
elseif ($LastExitCode -ne 0) { Write-Host "Other Error Occurred, aborting"; exit $LastExitCode }
|
||||||
|
@ -317,14 +317,17 @@ There are a couple reasons that code in Sphinx might be deprecated:
|
|||||||
no longer needs to support the older version of Python that doesn't include
|
no longer needs to support the older version of Python that doesn't include
|
||||||
the library, the library will be deprecated in Sphinx.
|
the library, the library will be deprecated in Sphinx.
|
||||||
|
|
||||||
As the :ref:`deprecation-policy` describes,
|
As the :ref:`deprecation-policy` describes, the first release of Sphinx that
|
||||||
the first release of Sphinx that deprecates a feature (``A.B``) should raise a
|
deprecates a feature (``A.B``) should raise a ``RemovedInSphinxXXWarning``
|
||||||
``RemovedInSphinxXXWarning`` (where XX is the Sphinx version where the feature
|
(where ``XX`` is the Sphinx version where the feature will be removed) when the
|
||||||
will be removed) when the deprecated feature is invoked. Assuming we have good
|
deprecated feature is invoked. Assuming we have good test coverage, these
|
||||||
test coverage, these warnings are converted to errors when running the test
|
warnings are converted to errors when running the test suite with warnings
|
||||||
suite with warnings enabled: ``python -Wall tests/run.py``. Thus, when adding
|
enabled::
|
||||||
a ``RemovedInSphinxXXWarning`` you need to eliminate or silence any warnings
|
|
||||||
generated when running the tests.
|
pytest -Wall
|
||||||
|
|
||||||
|
Thus, when adding a ``RemovedInSphinxXXWarning`` you need to eliminate or
|
||||||
|
silence any warnings generated when running the tests.
|
||||||
|
|
||||||
.. _deprecation-policy:
|
.. _deprecation-policy:
|
||||||
|
|
||||||
|
4
Makefile
4
Makefile
@ -69,7 +69,7 @@ reindent:
|
|||||||
|
|
||||||
.PHONY: test
|
.PHONY: test
|
||||||
test:
|
test:
|
||||||
@cd tests; $(PYTHON) run.py -v $(TEST)
|
@$(PYTHON) -m pytest -v $(TEST)
|
||||||
|
|
||||||
.PHONY: test-async
|
.PHONY: test-async
|
||||||
test-async:
|
test-async:
|
||||||
@ -77,7 +77,7 @@ test-async:
|
|||||||
|
|
||||||
.PHONY: covertest
|
.PHONY: covertest
|
||||||
covertest:
|
covertest:
|
||||||
@cd tests; $(PYTHON) run.py -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
@$(PYTHON) -m pytest -v --cov=sphinx --junitxml=.junit.xml $(TEST)
|
||||||
|
|
||||||
.PHONY: build
|
.PHONY: build
|
||||||
build:
|
build:
|
||||||
|
16
tests/run.py
16
tests/run.py
@ -1,16 +0,0 @@
|
|||||||
#!/usr/bin/env python
|
|
||||||
# -*- coding: utf-8 -*-
|
|
||||||
"""
|
|
||||||
Sphinx unit test driver
|
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
This script runs the Sphinx unit test suite.
|
|
||||||
|
|
||||||
:copyright: Copyright 2007-2017 by the Sphinx team, see AUTHORS.
|
|
||||||
:license: BSD, see LICENSE for details.
|
|
||||||
"""
|
|
||||||
import sys
|
|
||||||
|
|
||||||
import pytest
|
|
||||||
|
|
||||||
sys.exit(pytest.main(sys.argv[1:]))
|
|
@ -41,7 +41,8 @@ def test_ModuleAnalyzer_for_file():
|
|||||||
def test_ModuleAnalyzer_for_module():
|
def test_ModuleAnalyzer_for_module():
|
||||||
analyzer = ModuleAnalyzer.for_module('sphinx')
|
analyzer = ModuleAnalyzer.for_module('sphinx')
|
||||||
assert analyzer.modname == 'sphinx'
|
assert analyzer.modname == 'sphinx'
|
||||||
assert analyzer.srcname == SPHINX_MODULE_PATH
|
assert analyzer.srcname in (SPHINX_MODULE_PATH,
|
||||||
|
os.path.abspath(SPHINX_MODULE_PATH))
|
||||||
assert analyzer.encoding == 'utf-8'
|
assert analyzer.encoding == 'utf-8'
|
||||||
|
|
||||||
|
|
||||||
|
2
tox.ini
2
tox.ini
@ -22,7 +22,7 @@ deps =
|
|||||||
setenv =
|
setenv =
|
||||||
SPHINX_TEST_TEMPDIR = {envdir}/testbuild
|
SPHINX_TEST_TEMPDIR = {envdir}/testbuild
|
||||||
commands=
|
commands=
|
||||||
{envpython} -Wall tests/run.py --durations 25 {posargs}
|
pytest -Wall --durations 25 {posargs}
|
||||||
|
|
||||||
[testenv:flake8]
|
[testenv:flake8]
|
||||||
description =
|
description =
|
||||||
|
Loading…
Reference in New Issue
Block a user