* Fixes the "Installing <version>" assertions so that they don't false
positive against the "please upgrade to <version>" output.
* Removes modification of test fixtures during tests, since it can lead
to failures depending on test order, and confusion when debugging.
* Updates the PyPy version warning tests to use a slightly newer (but
still not latest) PyPy version, which means that the test now passes
on Cedar-14 and can be unskipped.
* Switches to using an empty requirements file for version tests that
duplicate the main test, to save spending time installing dependencies
unnecessarily.
* Switches the NLTK test to using the default buildpack Python version,
rather than an ancient Python 3.6.
* Skips the Python 3.7/3.8 tests on Cedar-14 rather than asserting
failure, since we know they'll never pass due to Cedar-14's libssl being
older than required.
* Removes redundant `testSqliteInstall` test since it duplicates the
Python version install tests.
Longer term I'll be moving many of the unit tests to Hatchet, however
this at least makes the tests more dependable in the meantime.
Closes @W-8060219@.
Closes @W-8176779@.
[skip changelog]
To prevent external environment variables from leaking into the tests,
which otherwise causes problems trying to write tests for #1011.
Several tests which were relying on this leak had to be fixed, so that
the env vars they were using are set using `ENV_DIR`, as happens in
production.
Fixes#1014.
Fixes#1015.
Previously the contents of the file being searched was not output,
making it hard to know how to fix a test so that it would pass.
Before:
```
$ make test-heroku-16
...
testCffi
ASSERT:Expected </tmp/shunit.ayVGAO/tmp/output.6gMs/stdout> to contain <ZZZZZZZ>
testPylibmc
```
After:
```
$ make test-heroku-16
...
testCffi
ASSERT:Expected </tmp/shunit.FXWeuI/tmp/output.7Vfx/stdout> to contain <ZZZZZZZ>
! Warning: Your application is missing a Procfile. This file tells Heroku how to run your application.
! Learn more: https://devcenter.heroku.com/articles/procfile
-----> Installing python-3.6.2
-----> Installing pip
-----> Installing requirements with pip
Collecting cffi (from -r /tmp/testBoLG0/requirements.txt (line 1))
Downloading cffi-1.10.0-cp36-cp36m-manylinux1_x86_64.whl (406kB)
Collecting pycparser (from cffi->-r /tmp/testBoLG0/requirements.txt (line 1))
Downloading pycparser-2.18.tar.gz (245kB)
Installing collected packages: pycparser, cffi
Running setup.py install for pycparser: started
Running setup.py install for pycparser: finished with status 'done'
Successfully installed cffi-1.10.0 pycparser-2.18
testPylibmc
```
In cases where there is no stderr there was previously no output,
which made it hard to find the cause. The assertion messages have
also been adjusted to remove the repetition (shunit2 already outputs
expected vs actual itself).
Before:
```
testPipenv
ASSERT:Expected captured exit code to be 0; was <2> expected:<0> but was:<2>
testPipenvVersion
```
After:
```
testPipenv
ASSERT:Captured exit code - expected:<0> but was:<2>
! Warning: Your application is missing a Procfile. This file tells Heroku how to run your application.
! Learn more: https://devcenter.heroku.com/articles/procfile
-----> Installing python-2.7.13
-----> Installing pip
-----> Generating 'requirements.txt' with pipenv
testPipenvVersion
```
Fixes#389.