Commit Graph

100 Commits

Author SHA1 Message Date
Damian Shaw 68529081c2
Enforce f-strings via Ruff (#12393) 2023-11-07 09:14:56 +00:00
Tzu-ping Chung 60d3c0447e Skip tests that do not make sense on Python 3.12+ 2023-07-04 17:04:09 +08:00
Stéphane Bidoul 8f52335ae5 xfail test with colon in console entry point name
This was supported by setup.py install but not by our wheel
installation logic.
2023-03-27 11:55:20 +01:00
Stéphane Bidoul a4c91124ce Update entrypoint tests
console_script entrypoints declarations are stricter when
we don't use setup.py install.
2023-03-27 11:55:20 +01:00
Stéphane Bidoul 1800635e4c
Fix tests with indented errors and warning 2022-08-05 09:35:00 +02: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
Tzu-ping Chung 8073f65c14 Properly normalize and handle linked dist 2022-04-12 03:33:18 +08:00
Tzu-ping Chung 675de98f42 Better test setup and teardown with fixture 2022-04-12 03:31:50 +08:00
q0w db71def50f replace git scheme with https 2022-03-19 14:17:05 +03:00
Tzu-ping Chung e0c7f24ee4
Merge pull request #10511 from uranusjr/metadata-uninstall 2021-11-22 09:54:15 +08:00
Tzu-ping Chung f9250d29c9 Fix typing for uninstallation test 2021-11-21 23:43:49 +08:00
Jon Dufresne c71cf88049 Complete type annotations of tests/functional/ directory 2021-11-18 18:26:17 -08:00
Tzu-ping Chung ebd693e0b5 Abstract pkg_resources from uninstall operation 2021-11-18 17:55:38 +08:00
Stéphane Bidoul 040cc391ba
Make in-tree-build the default
Add an out-of-tree-build feature flag to ease the transition.
2021-09-25 13:11:01 +02:00
Jon Dufresne 4a4103e173 Replace use of pretend library with unitest.mock in tests
The pretend library was used by very few tests. In all cases, it is
simple enough to switch to stdlib unitest.mock.

Using stdlib means there is one fewer library to install before running
tests. It can also simplify mypy usage via typeshed.
2021-09-03 16:23:28 -07:00
Pradyun Gedam 585037a80a
Cleanup implicit string concatenation 2021-08-20 13:37:52 +01:00
Pradyun Gedam 94999255d5
Reformat the codebase, with black 2021-08-20 13:37:49 +01:00
Guy Tuval 239a307372
Error handling upon `uninstall` invalid parameter (#10171)
Co-authored-by: Tzu-ping Chung <uranusjr@gmail.com>
2021-07-24 21:24:30 +08:00
Tzu-ping Chung e6c317769a Move assert_[not_]installed to Script and use it
This help function is much better than the previous ad-hoc logic used in
test_uninstall.py, which has trouble identifying normalized names.
2021-07-12 11:44:23 +08:00
Miro Hrončok f77649e841 Provide a better error message when uninstalling packages without dist-info/RECORD
Fixes https://github.com/pypa/pip/issues/8954
2021-05-10 21:56:59 +02:00
Tzu-ping Chung c72631a5f1 Pin setuptools under 52 for easy_install tests 2021-01-25 22:16:58 +08:00
Hugo van Kemenade 1cabd3a609 The future is now 2020-12-28 18:34:06 +02:00
Pradyun Gedam 58c594c06b
Prepare isort for black 2020-09-23 21:47:47 +05:30
Pradyun Gedam 25ab172b55
Update linter: isort 2020-09-23 19:52:28 +05:30
Nguyễn Gia Phong c84ef7a67c Mark tests using remote svn and hg as xfail
The source repositories for testing is no longer available.
2020-08-24 09:43:50 +07:00
Devesh Kumar Singh bd70025c98 Remove --always-unzip based tests 2020-06-25 16:52:15 +05:30
gutsytechster c4551ac236 refactor(test_uninstall.py): Add helper methods for path lookups 2020-05-30 23:43:48 +05:30
Pradyun Gedam 4297b8d9b7
Revert "fix test_uninstall_console_scripts"
This reverts commit 877e1ccc77.
2020-05-13 02:50:07 +05:30
Stéphane Bidoul 877e1ccc77
fix test_uninstall_console_scripts
This particular test checks which files are
created. Since we now build in place, expect the .egg-info directory to be created.
2020-04-12 12:00:58 +02:00
Devesh Kumar Singh 0d2954d726 Add test to ensure egg-link is removed after uninstall 2020-03-30 01:31:08 +05:30
Devesh Kumar Singh 0acfdcd719 Check for uninstalled package after deleting pth file 2020-03-28 11:07:52 +05:30
Devesh Kumar Singh bcb4009688 Add a test case for missing easy-install.pth fix 2020-03-28 02:14:29 +05:30
Jason R. Coombs 3511d3d493 Convert the remaining '%' formatters to '.format'. Fixes #6973. 2020-03-06 12:43:03 -05:00
Christopher Hunt 7e65a5a40f
Merge pull request #7578 from uranusjr/test-uppercase-console-scripts
Add test for uppercase script name
2020-01-13 09:42:38 +08:00
Tzu-ping Chung 8e72502118 Add test for uppercase script name 2020-01-12 17:16:52 +08:00
Tzu-ping Chung 4def73ca3a Refactor test to remove unneeded network dep 2020-01-12 17:12:08 +08:00
Tzu-ping Chung 10022df906 Rename test to make its intention clearer 2020-01-12 17:03:28 +08:00
Chris Hunt 7af9371176 Remove redundant expect_error=False in tests
This is the default, so there is no need to specify it explicitly.
2020-01-03 14:25:36 +01:00
Chris Hunt 8d38b37052 Ignore WARNING emitted by setuptools during test 2019-11-23 16:17:35 -05:00
Harsh Vardhan 0e6ac42c93 Add need_svn decorator for tests which require svn
Signed-off-by: Harsh Vardhan <harsh59v@gmail.com>
2019-10-15 17:22:16 +05:30
Chris Jerdonek 188ec6ff4e Don't pass "/trunk" when calling local_checkout() with svn. 2019-09-21 03:29:34 -07:00
Chris Jerdonek d7709fa106 Assert that initools_dir doesn't already exist. 2019-09-21 02:31:32 -07:00
Christopher Hunt b1bc41b2c3
Merge pull request #6914 from sbidoul/pip6892-sbi
uninstall: remove symlinks created by flit install --symlink
2019-09-17 21:14:28 -04:00
Chris Jerdonek 9a765b8cab Change local_checkout() to accept tmpdir. 2019-09-13 21:41:32 -07:00
Stéphane Bidoul (ACSONE) 04bc6d090d
Remove non standard function from Path class 2019-09-06 09:42:06 +02:00
Stéphane Bidoul (ACSONE) f8d58256b7 Add failing test for symlink uninstall 2019-08-24 00:36:40 +02:00
Chris Hunt 0a6b3cedae Remove unnecessary expect_error. 2019-08-10 22:39:57 -04:00
Chris Hunt 39ac9ca351 Rename compatible functions in tests.lib.path.Path. 2019-07-02 18:48:44 -04:00
Florian Rathgeber 6278c6c371 Decorate tests using SVN with pytest.mark.svn (#5944) 2018-11-10 17:13:20 +05:30
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