Commit Graph

34 Commits

Author SHA1 Message Date
Damian Shaw 68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
Stéphane Bidoul 58d8dc28cb
Do not fail tests on our own deprecation warnings 2022-08-05 09:35:00 +02:00
Paul Moore ea2318fbf9 Minor zipapp-related fixes and skips for some tests 2022-07-12 10:12:17 +01:00
Tzu-ping Chung 42359a9605 Migrate tests to use pathlib.Path
The pip-specific Path implementation has been removed, and all its
usages replaced by pathlib.Path. The tmpdir and tmpdir_factory fixtures
are also removed, and all usages are replaced by tmp_path and
tmp_path_factory, which use pathlib.Path.

The pip() function now also accepts pathlib.Path so we don't need to put
str() everywhere. Path arguments are coerced with os.fspath() into str.
2022-06-08 19:58:46 +08:00
Jon Dufresne 72937f6520 Complete type annotations for tests/conftest.py and tests/lib/* 2021-09-29 19:57:29 -07:00
Pradyun Gedam 4d933d2e10
Use a stricter regex for matching the Python version
Co-authored-by: Kevin Puetz <puetzk@puetzk.org>
2021-08-06 15:55:55 +01:00
Pradyun Gedam 35b938b42e
Permit multi-character segments in Python versions, in a test
This is necessary since Python 3.10 has two digits in the minor version.
2021-08-06 13:42:31 +01:00
Pradyun Gedam a196b3bf01
Minor formatting tweaks (#10190)
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
2021-07-24 03:55:14 +08:00
Pradyun Gedam ebb80861ee
Blacken tests/lib 2021-04-02 11:59:57 +01:00
Andrey Bienkowski 9b2cb894ba Convert more str.format() calls to f-strings 2021-02-13 09:27:17 +03:00
Jon Dufresne cdcf74fb8e Use f-strings for simple string formatting
Use pyupgrade to convert simple string formatting to use f-string
syntax. pyupgrade is intentionally timid and will not create an f-string
if it would make the expression longer or if the substitution parameters
are anything but simple names or dotted names.
2020-12-25 16:21:20 -08:00
Jon Dufresne f32adaf09b Remove __future__ imports
Unnecessary since dropping Python 2.
2020-12-24 08:38:09 -08:00
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Chris Hunt 73e33ae803 Assert that expect_error script invocations return non-zero. 2019-08-12 16:27:25 -04:00
Chris Jerdonek 0b8377d53f Move run_with_log_command() after run_stderr_with_prefix().
We do this to better parallel the test order in TestPipTestEnvironment,
since the tests using run_with_log_command() occur later.
2019-05-07 07:05:01 -04:00
Chris Jerdonek 46fc5ccf45 Add failing test. 2019-05-07 06:51:42 -04:00
Chris Jerdonek bef5b2e6f3 Improve PipTestEnvironment to check for logging errors. 2019-05-06 14:55:16 -04:00
Chris Jerdonek 66ae68122f Disallow two more argument combinations, and test. 2019-03-26 20:34:23 -07:00
Chris Jerdonek ac18393df7 Make expect_stderr mean the weaker allow_stderr_warning. 2019-03-26 20:34:23 -07:00
Chris Jerdonek bb290e10f2 Address review comments, and add tests. 2019-03-20 02:08:37 -07:00
Paul Moore 1bdbd6ccea Testing for pip version didn't cater for beta releases 2018-03-31 13:02:05 +01:00
Donald Stufft 95bcf8c5f6 Move all internal APIs to pip._internal 2017-08-31 14:53:00 -04:00
Pradyun S. Gedam 1832569530 Sort all imports 2017-05-16 15:47:47 +05:30
Donald Stufft f50bd8a9ea Don't assume versions are single digit 2017-03-20 11:37:15 -04:00
Bussonnier Matthias 0582a91e62 Do not shadow submodules
using object that have the same name as submodules as the weird effect
of makeing `import pip.commands.<something> as <anothername>` fail with
a key error. This fixes it by renamin commands as command_dict and fixin
a few imports to accomodate.

Related to #2149
2014-12-12 16:06:04 +01:00
Donald Stufft 9f027337a8 Use Flake8 on the test of pip's Python files 2014-01-28 19:47:58 -05:00
Donald Stufft fe60a1d5cf Use a constant for the source directory 2013-08-27 06:49:40 -04:00
Donald Stufft 1bd8dd99f8 Determine the src directory automatically 2013-08-27 06:49:40 -04:00
Donald Stufft 0c42245f21 Replace explicit calls to reset_env() with the script fixture 2013-08-27 06:47:23 -04:00
Donald Stufft 9894c8baac Refactor tests.lib
* Move virtualenv creation out of TestPipEnvironment
* Remove global state and force explicit use of TestPipEnvironment
  instances
* Remove "backup" virtualenv copying and instead create new
  virtual environments each time.
* Remove the monkeypatched "PyPICache" functionality
* Remove things that were not being used anymore and were dead
  weight
* Remove sitecustomize support which was primarily used to
  monkeypatch the "PyPICache" but was used in one or two other
  tests.
2013-08-21 22:40:16 -04:00
Donald Stufft da0bc4b1d1 Switch to using py.test as the test runner instead of nose
* Better output with the bare asserts we use throughout the tests
* Function fixtures are pretty nice, especially as a way to
  start a background server or create an isolated virtualenv
2013-08-21 10:19:58 -04:00
Marcus Smith ff1a79381a test changes due to virtualenv not using distribute 2013-06-13 22:43:26 -07:00
Marcus Smith 28298c413d more functional/unit tests restructure 2013-05-29 13:41:13 -07:00
Marcus Smith 2e2ce0f4e9 break up tests dir into data, unit tests, and functional tests 2013-05-29 13:41:12 -07:00
Renamed from tests/test_test.py (Browse further)