Jon Dufresne
09b3d3a50b
Remove object from class definitions
...
Unnecessary since dropping Python 2 support. In Python 3, all classes
are new style classes.
2020-12-25 15:48:11 -08:00
Jon Dufresne
2e38024991
Drop u prefix from str literals
...
Unnecessary since dropping Python 2 support.
This makes one test case from test_str_to_display a duplicate and so has
been removed.
2020-12-25 07:26:06 -08:00
Hugo van Kemenade
817ee23051
Remove redundant Python 2.7 code
2020-12-22 09:06:26 +02:00
Pradyun Gedam
79f1b59335
We have no deprecated versions of Python now
2020-12-19 19:55:09 +00:00
Tzu-ping Chung
145be2eaf2
Skip pip search tests unless explicitly requested
2020-12-15 17:23:20 +08:00
Pradyun Gedam
6f26fb9fee
Update tests for resolver changes
2020-10-30 23:08:31 +05:30
Pradyun Gedam
6859de08d9
Get the resolver name directly from test CLI
2020-10-30 07:16:25 +05:30
Pradyun Gedam
07ec3013f0
Drop custom logic for new_resolver tests
2020-10-30 07:16:19 +05:30
Pradyun Gedam
5cba61e118
Switch to resolver variants in the test suite
2020-10-30 07:16:19 +05:30
Pradyun Gedam
66bb8a88c4
Add a small delay between re-runs
2020-10-25 23:03:10 +05:30
Pradyun Gedam
9faf431fbb
Breakup conditional for readability
2020-10-25 23:02:59 +05:30
Pradyun Gedam
25ab172b55
Update linter: isort
2020-09-23 19:52:28 +05:30
Xavier Fernandez
822d42b11a
Merge pull request #8614 from McSinyx/monkeypatch.setenv
...
Use monkeypatch.setenv to mock env vars
2020-09-04 11:05:15 +02:00
Nguyễn Gia Phong
4a2e03c4ff
Use monkeypatch for env var in wheel unit tests
2020-09-04 15:06:08 +07:00
Nguyễn Gia Phong
cd549eb7f1
Use mock to patch for TZ env var
2020-09-04 15:06:08 +07:00
Hugo
e93257c080
Warn Python 3.5 support is deprecated and will be removed in pip 21.0, Jan 2021
2020-08-18 15:22:16 +03:00
Nguyễn Gia Phong
5b1093fc75
Use monkeypatch.*env in conftest and tests.lib
...
Session fixtures have to use mock.patch.dict though
2020-07-25 20:46:45 +07:00
Chris Hunt
cb540f30e3
Add basic test coverage configuration
...
This handles:
* Sub-processes within unit tests (thanks pytest-cov)
* Our pytest-fixture-based virtual environments and subprocesses
therein
* Running with xdist (e.g. `-n auto`)
* Combining results from all of the above using paths rooted with
`src/pip/*`
This doesn't handle:
* Platform-specific branches
* Python 2
* CI integration
2020-07-07 21:58:55 -04:00
Pradyun Gedam
49b793cd03
Set correct envvar for new-resolver tests
2020-07-03 20:11:36 +05:30
Sumana Harihareswara
cef69fef7f
Updated author email in configuration and tests
...
Per https://groups.google.com/d/msg/pypa-dev/rUNsfIbruHM/LCEx-CB5AgAJ
the pypa-dev Google Group is now decommissioned.
Using distutils-sig instead as author/maintainer email.
Signed-off-by: Sumana Harihareswara <sh@changeset.nyc>
2020-05-28 16:51:02 -04:00
Paul Moore
c2fa0dd997
Add a mark for tests that fail on the new resolver
2020-05-21 15:39:00 +01:00
Tzu-ping Chung
a82a5e7abe
Add pytest option to globally switch resolver
2020-05-14 18:00:42 +08:00
Ilan Schnell
6db7f42186
sort imports
2020-03-31 01:42:40 -05:00
Ilan Schnell
2c6a063a27
remove proxy module tests/lib/scripttest.py in favour of importing from tests.lib directly
2020-03-31 01:25:45 -05:00
Jason R. Coombs
6282a307dc
👹 Feed the hobgoblins (delint).
2020-03-06 12:43:10 -05:00
Jason R. Coombs
3511d3d493
Convert the remaining '%' formatters to '.format'. Fixes #6973 .
2020-03-06 12:43:03 -05:00
Chris Hunt
f2af7df453
Use tempdir_registry to control auto-deleted files globally
...
Next we can actually transition some files to be globally-managed that
are only deleted conditionally.
2020-01-29 23:04:26 -05:00
Tzu-ping Chung
facf5c8894
Add comments to unicode workarounds
2020-01-09 13:11:30 +05:30
Tzu-ping Chung
37f97140af
Also use rmtree to remove tmpdir_factory
...
Same as e2c3451001
2020-01-09 13:00:49 +05:30
Tzu-ping Chung
e2c3451001
Delete tmpdir with rmtree to handle Unicode paths
...
pytest (rather py.path.local) does not handle non-ASCII paths properly
on Windows with Python 2, but Python's builtin shutil.rmtree() does.
Co-authored-by: Pradyun Gedam <pradyunsg@gmail.com>
2020-01-08 18:26:42 +05:30
Chris Hunt
82a2651f93
Move pip._internal.main to cli submodule
...
Moving this out of the way gives us the flexibility to define wrappers
that will redirect requests to our old entrypoints to our new one.
2019-12-18 21:09:22 -05:00
Chris Hunt
6343e8093f
Replace atexit with globally-managed tempdir
2019-12-09 06:06:37 +08:00
Chris Hunt
1daa8b2fd9
Add mock server wrapper and replace network calls in a test
2019-11-17 17:36:36 -05:00
Chris Hunt
204a004377
Add test helpers for HTTP(S) server and certs
2019-11-03 17:05:52 -05:00
Chris Hunt
0c4625b2ba
Use another shared script in pip list tests
2019-10-30 02:16:23 -04:00
Chris Hunt
6cd9852626
Use shared script in pip list tests
2019-10-30 01:55:32 -04:00
Chris Hunt
ae4ad85e5f
Make virtualenv/script fixture factories
2019-10-29 23:41:34 -04:00
Xavier Fernandez
8df9329396
Add release target
2019-10-14 14:23:00 +02:00
Pradyun Gedam
37bc629551
Rename tests.lib.path.Path.{abspath -> resolve()}
2019-10-07 18:01:06 +05:30
Christopher Hunt
3b7d2eee5e
Merge pull request #7061 from chrahunt/refactor/move-code-out-of-init
...
Move code out of pip._internal.__init__
2019-09-26 13:36:35 -04:00
Chris Hunt
3e98ee8464
Use from ... import ... style
2019-09-24 21:36:16 -04:00
Pradyun Gedam
40a0f189b9
Enable check-builtin-literals
2019-09-24 18:03:22 +05:30
Chris Hunt
09fd200c59
Move pip._internal:main
to its own module
...
Moving content out of `__init__` is preferred in general because it
avoids conflicts with module names and unnecessary imports.
2019-09-21 15:27:39 -04:00
Albert Tugushev
e3a6ba6396
Use normal fixture instead of yield_fixture
...
It's been deprecated since pytest>=2.10.
See https://docs.pytest.org/en/latest/historical-notes.html#pytest-yield-fixture-decorator
2019-09-16 02:55:47 +03:00
Pradyun Gedam
ceaf514189
Drop support for EOL Python 3.4 (2) ( #6782 )
...
Merge pull request #6782 from hugovk/rm-3.4
2019-09-10 09:28:11 +05:30
Chris Hunt
2571398f4d
Fix tests when running in git linked worktree.
2019-08-07 22:59:10 -04:00
Hugo
8f32b8f425
Drop support for EOL Python 3.4
2019-07-23 22:49:21 +03:00
Chris Hunt
9281a7aac1
Remove copytree from tests.lib.path.Path.
2019-07-20 19:46:47 -04:00
Chris Hunt
39ac9ca351
Rename compatible functions in tests.lib.path.Path.
2019-07-02 18:48:44 -04:00
Miro Hrončok
d4264dc3b2
Pytest: Use get_closest_marker
...
See https://github.com/pytest-dev/pytest/pull/4564
2019-04-04 13:07:49 +02:00
Chris Jerdonek
5b9065cf5a
Make deprecated_python cause allow_stderr_warning not expect_stderr.
2019-03-26 20:32:49 -07:00
Philip Jägenstedt
511c88dc4a
Fix typo: wheither -> whether
2019-01-31 00:58:48 +01:00
Donald Stufft
a44579ca2d
Fix tests for deprecated Pythons
2019-01-19 15:01:33 -05:00
Xavier Fernandez
b268c67f84
Deprecate Python 3.4
2019-01-12 22:08:24 +01:00
Xavier Fernandez
5e573df69c
Add deprecate_python fixture to easily deprecate python versions
...
pip usually emits a warning and tests have to be adapted
2019-01-12 21:50:40 +01:00
Pradyun Gedam
7a23cc8a18
Don't copy pip's non code files and folders in tests
2018-11-29 14:37:18 +05:30
Paul Moore
48e9cb693f
Address test failures
2018-10-29 23:32:13 +01:00
Benoit Pierre
744b8cf96e
improve build environment
...
- check build requirements for conflicts
- better isolation (ignore system site packages)
- support 2 prefixes: a "normal" one, and an "overlay" one
(with higher priority over "normal")
2018-10-29 23:17:51 +01:00
Benoit Pierre
0b45fdad6c
tests: improve temporary directories cleanup
2018-10-21 21:43:32 +02:00
Benoit Pierre
a4209aa0fb
tests: add support for using venv for the virtual environment
...
Add a new testsuite option `--use-venv` to enable the use of `venv`
for creating a test virtual environment. The option is opt-in because
creating a `venv` environment does not work right when running under a
`virtualenv`; which is why `tox-venv` must be used in combination with
tox.
2018-10-21 21:43:32 +02:00
Benoit Pierre
add3801163
tests: rework tests virtual environment
...
- cleanup virtualenv creation code
- ensure all testing virtual environments use a recent version
of setuptools / wheel, making it easier to switch to custom
versions of those, as well as reducing network accesses
- reduce size of testing virtual environment, slightly speeding
up the testsuite
2018-10-18 23:28:37 +02:00
Paul Moore
3a485da63e
Make keeping the tmpdir a command line option
2018-07-30 15:27:58 +01:00
Paul Moore
7be0c888df
Shut flake8 up
2018-07-30 14:39:58 +01:00
Paul Moore
65d5b47434
Add an environment variable to keep temporary directories when testing
2018-07-30 14:19:41 +01:00
Benoit Pierre
43b8ed4945
detect fork-bombs during build dependencies installs
2018-06-26 10:40:23 +02:00
Benoit Pierre
02b678f557
fix PEP 518 support when pip is installed in the user site
...
Do not use the build environment isolation during the build dependencies installation.
2018-04-16 22:58:44 +02:00
Benoit Pierre
cbca713046
tests: fix testsuite virtualenv support
...
Fix sites ordering: add user site first, before system site.
2018-04-15 10:47:56 +02:00
Benoit Pierre
d0aa80a47a
tests: fix testsuite virtualenv isolation
...
Ensure `virtualenv.system_site_packages = True` (needed for testing
`--user`) does not result in adding the real site-packages' directory
to `sys.path`.
2018-04-15 10:47:47 +02:00
Anthony Sottile
e21e2d3f8f
Upgrade syntax in ./tests
...
Changes were automated via https://github.com/asottile/pyupgrade
See #4921
2017-12-14 21:59:41 -08:00
Benoit Pierre
961737ab98
Fix integration tests on Windows ( #4769 )
2017-10-06 20:51:42 +01:00
Benoit Pierre
e792c48ac8
tests: speedup testsuite
...
Speedup virtualenv creation: create one (per session) relocatable
virtual environment, and then just make a copy of the resulting tree
when a new virtualenv is needed.
2017-09-02 02:19:55 +02:00
Benoit Pierre
6a930d5233
tests: remove old workaround for Travis failures
2017-09-02 02:18:33 +02:00
Donald Stufft
95bcf8c5f6
Move all internal APIs to pip._internal
2017-08-31 14:53:00 -04:00
Xavier Fernandez
b709b1ef4a
Add a common_wheels fixtures providing wheel & setuptools wheels
2017-07-21 18:08:53 +02:00
Pradyun S. Gedam
a24c59fc27
Only apply re-runs marker on CI runs ( #4541 )
2017-06-17 12:21:14 -04:00
Pradyun S. Gedam
9923c1ad7e
Sort imports and minor Flake8 changes ( #4520 )
...
* Run isort on the codebase
Command: isort --recursive --skip __main__.py --skip _vendor -o pip._vendor -sd THIRDPARTY -m 5 -p pip -p tests ./pip ./tests
* 📰
2017-06-13 14:17:00 +02:00
Pradyun S. Gedam
8d66105cd7
Mark network tests as flaky
2017-05-19 08:48:45 +05:30
Pradyun S. Gedam
1832569530
Sort all imports
2017-05-16 15:47:47 +05:30
Alex Gaynor
bc956b6a2c
Sigh, stdout is not a consistent type
2017-03-26 11:49:02 -04:00
Alex Gaynor
96713c35a8
Normalize imports
2017-03-26 11:18:29 -04:00
Alex Gaynor
ef7db41728
Do the monkey patch instead
2017-03-26 11:17:02 -04:00
Bruno Oliveira
7aa30dbb8e
Change "tmpdir" fixture to work with latest pytest
...
Re-using the built-in tmpdir fixture fixes pytest-dev/pytest#1083
Also with latest pytest there's no need to use --assert=plain on py35 anymore
Fixes #3699
Fixes pytest-dev/pytest#1083
2016-07-21 21:50:34 -03:00
Donald Stufft
5bbf3fd3ff
Only delete the user cache if it's populated
2015-05-13 18:11:19 -04:00
Robert Collins
08acb6670d
Issue #2140 : Build wheels automatically
...
Building wheels before installing elminates a cause of broken environments -
where install fails after we've already installed one or more packages.
If a package fails to wheel, we run setup.py install as normally.
2015-04-13 18:33:07 +12:00
Marc Abramowitz
60d09fe748
Ignore DoctestTextfile when collecting
...
Prevents this error:
$ tox -e py27 -- -m unit
...
INTERNALERROR> File "/Users/marca/dev/git-repos/pip/tests/conftest.py", line 16, in pytest_collection_modifyitems
INTERNALERROR> item.module.__file__,
INTERNALERROR> AttributeError: 'DoctestTextfile' object has no attribute 'module'
2015-03-19 14:24:25 -07:00
Marc Abramowitz
7bd8dafef6
conftest: Copy a few less things to virtualenvs
2015-03-15 10:55:36 -07:00
Marc Abramowitz
b02c3f8acb
conftest: Copy less stuff to virtualenvs
...
This shaves a few seconds off each test.
2015-03-15 04:45:50 -07:00
Donald Stufft
0bc8aa5622
Style fixes for the latest flake8
2015-02-24 07:46:10 -05:00
Donald Stufft
c0e8753c6e
Don't check pip version in tests
2014-12-23 19:37:22 -05:00
Davidovich
97f3cebe1b
Do not use hardcoded slash separator for windows support
2014-12-16 21:43:34 -05:00
Donald Stufft
68c0b472a7
Run the unit tests before the integration tests
2014-06-30 20:00:35 -04:00
Donald Stufft
97d8bee705
Isolate our tests from the running user's configuration
2014-05-07 16:17:07 -04:00
Paul Moore
92c3a673fd
Fix tests on Windows, where Path objects were changing to strings mysteriously...
2014-04-28 15:38:39 +01:00
Donald Stufft
1e29f9eb6f
Cleanup after each test case
2014-02-10 13:01:52 -05:00
Donald Stufft
9f027337a8
Use Flake8 on the test of pip's Python files
2014-01-28 19:47:58 -05:00
Donald Stufft
6c36e77e16
Work around Python 3.2 import issues
2013-09-05 10:39:28 -04:00
Donald Stufft
3c733ca0f5
Fix the exclusion patterns
...
We need the docs directory for ``python setup.py``
2013-08-28 05:32:57 -04:00
Donald Stufft
37deb59853
shutil.ignore_patterns does not want trailing slashes
...
A trailing slash in a directory name is essentially a noop unless
the directory name itself contains a trailing slash.
2013-08-28 05:17:36 -04:00
Donald Stufft
2ab9d6bdfb
Ignore the directories that tox creates
2013-08-28 05:05:07 -04:00
Donald Stufft
4516a34e1c
Add an extra newline
2013-08-27 06:49:40 -04:00