This essentially allows me to do an overall check general check by running the tests using pytest's `-k basic` syntax. Given that I like running tests often and that, in general, I make typos more often than changes that break core functionality, I think this will reduce cycle times for me.
* fix test not using temporary directory
* avoid creating a `cache_dir` directory in the source tree
* drop `data` fixture from tests that don't use it
* tests: fix pytest warning
When listing found packages, `print_results()` uses the last version in
the versions list of a package, but that version is not necessarily the
latest. For example, `SearchCommand.search()` may return the following
(tested with JFrog Artifactory PyPI repo):
pypi_hits = command.search(args, options)
[{'_pypi_ordering': 1,
'name': 'testlib',
'summary': 'Test library.',
'version': '1.0.5'},
{'_pypi_ordering': 0,
'name': 'testlib',
'summary': 'Test library.',
'version': '1.0.3'}]
`pip.commands.search.transform_hits()` preserves the order of versions:
hits = pip.commands.search.transform_hits(pypi_hits)
[{'name': 'testlib',
'summary': 'Test library.',
'versions': ['1.0.5', '1.0.3']}]
`pip.commands.search.print_results()` uses the last version in the list:
pip.commands.search.print_results(hits)
testlib (1.0.3) - Test library.
Expected result:
testlib (1.0.5) - Test library.
`print_results()` uses `highest_version()` already to compare the
installed version with the latest found version (for installed
packages). Same function is used in this fix to show the latest
versions of all found packages.
- unmark test_multiple_search for failure
- search for nonexistentpackage instead of non-existent-package since PyPI
seems to fallback to searches about "package" and manages to find
things...
This is a rebased final version of a proposed solution to fix
issues #932, #1104 & #1180. Following changes have been done:
* Implemented a new class `PipXmlrpcTransport` using a
contained `PipSession` object.
* Modified the `pip/commands/search.py` to make use of the
`PipXmlrpcTransport` class.
* Properly initialized options for testing `SearchCommand`:
- Changed `options_mock` to an `options` object built from
`parse_args`, to properly initialize default options.
2) have `create_main_parser` mark the parser as the 'main' parser.
3) remove an extraneus block that's never called. thanks @netspyer.
4) move 'create_main_parser` to __init__ to avoid circular or embedded imports.
* 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.