Bryan Bennett
ba0cf20e0f
Update tests to expect new output strings
2024-04-22 08:40:43 -04:00
Arthur Noel
f2612a6166
tests: don't touch HOME
2023-12-03 12:51:38 +00:00
Arthur Noel
980ccb419e
testspin testenv use nixpkgs unstable
2023-12-03 12:51:26 +00:00
Arthur Noel
3e3bde71b3
tests: use tests/testenv
2023-12-03 11:32:06 +00:00
Jörg Thalheim
d5a10dc6d5
test: other random ruff lints
2023-11-29 08:32:38 +01:00
Jörg Thalheim
8c46f6e97d
tests: don't use print in favour of logger
2023-11-29 08:28:52 +01:00
Jörg Thalheim
9ac34be48f
test: use builtins for type annotations instead of List / Optional
2023-11-29 08:28:52 +01:00
Jörg Thalheim
26b7fce564
tests: avoid shadowing dir builtin
2023-11-29 08:15:20 +01:00
Jörg Thalheim
ae4a4e8e7c
make tests directory a proper python module
2023-11-29 08:14:14 +01:00
Jörg Thalheim
037cc9cc25
format with treefmt
2023-11-29 07:34:23 +01:00
Jörg Thalheim
1133b15e75
add treefmt
2023-11-29 07:34:23 +01:00
Andrew Marshall
92eb25521e
Run tests with and without direnv’s strict_env
...
It seems unlikely that the “without” case will have any errors that the
“with” case doesn’t, but it’s still a common use case and easy enough to
parametrize.
2023-04-14 12:43:34 -04:00
Andrew Marshall
857bcd5c4f
Remove unneeded shebangs from test files
...
The files are not executable, tests should only be run via `pytest`, and
some of them were incorrectly python2.
2023-04-14 12:43:34 -04:00
Andrew Marshall
6bbfbf5af5
Fix failing tests
...
In 988193f812
a new input was added to the
flake, and thus broke this test.
2023-04-14 11:31:44 -04:00
Jörg Thalheim
471aa92765
sort imports with ruff
2023-01-16 14:09:00 +01:00
Jörg Thalheim
28a0597659
graceful fallback if no nixpkgs is in NIX_PATH
2023-01-16 14:06:09 +01:00
Bryan Bennett
77efe5abca
Fix tests for empty nixfile
2022-12-09 20:20:50 -05:00
Bryan Bennett
0db25e4de9
Don't track $nixfile if it is empty
2022-12-06 15:55:11 -05:00
Quentin Aristote
f9c23f2c67
test_gc: remove useless call to list
2022-10-21 15:06:50 +02:00
Quentin Aristote
05a6325387
test_gc: correct use of use_nix --arg
2022-10-21 15:03:02 +02:00
Quentin Aristote
db0e37ea65
test_gc: force change of env by passing arg to shell.nix
2022-10-21 12:18:32 +02:00
Quentin Aristote
391285f590
test_gc: remove debug prints
2022-10-20 16:29:24 +02:00
Quentin Aristote
edb067d0f4
test_gc: cleaning: pass --impure to use flake to force update of environment
2022-10-20 15:56:42 +02:00
Quentin Aristote
6c18aabfdd
test_gc: check number of profiles and rc files in .direnv separately
2022-10-20 15:23:17 +02:00
Quentin Aristote
24d0af43fa
test that .direnv/ gets cleaned
2022-10-20 13:07:45 +02:00
Jörg Thalheim
d74ad21a58
tests: test arguments passed to use_nix
2022-06-01 08:51:57 +02:00
Jörg Thalheim
0530ef449f
test_gc: fix returncode check
2022-06-01 08:25:59 +02:00
Jörg Thalheim
078b023769
testenv: use mkShellNoCC
...
This shell does no longer need to download a c compiler, which speed up
things quite a bit.
2022-06-01 08:20:43 +02:00
Jörg Thalheim
748988f4b9
rewrite tests using pytest
...
this allows us to use fixtures that are more flexible
2022-06-01 08:20:43 +02:00
Bryan Bennett
2dfdd127bd
Make test messages consts rather than class state
2022-04-03 20:45:35 -04:00
Eric Wolf
a18e37535d
Fix tests
...
- `renewed_message` is now the same for `use nix` and `use flake`.
- we now expect `shellHook` to run, whether the environment is cached
or not
2022-04-03 20:45:23 -04:00
Jörg Thalheim
01b5bf6eb6
test: remove nix flake check
2021-11-15 14:35:49 +01:00
ryneeverett
5c65694ea8
test.py: isolate assertions; DRY data generation
...
The majority of the test code is just creating the stdout data against
which to make assertions. Increasing the test cases will be more
manageable if the assertions are separate from this data generation.
It is also a generally preferred style to have one assertion per test,
because this way all assertions run even if others fail and each test
only fails for one reason. It also facilitates better test documentation
and adding additional tests without increasing complexity.
2021-06-11 15:13:57 -04:00
ryneeverett
6e68ea7235
flakes: Don't run shellHook on cached dev shells
...
This makes the behavior of `use flake` consistent with that of `use
nix`.
Resolve #90 .
2021-06-08 20:51:07 -04:00
Jörg Thalheim
763d572df3
properly register flake source gc root
...
Before it just add a gc root with to a symlink to the current directory.
2021-02-11 08:59:09 +01:00
Jörg Thalheim
1c8f93e60e
define nixpkgs input
...
otherwise it could be anything defined by the user
2021-02-11 08:41:45 +01:00
Jörg Thalheim
4aad17c4a1
tests: extend use_flake tests
2020-12-25 18:30:52 +01:00
Jörg Thalheim
47da3c88c7
tests: fix flake feature check
2020-12-25 18:30:52 +01:00
Jörg Thalheim
8b067fb376
extend ci to nixUnstable/macOS
2020-08-10 22:51:51 +01:00
Jörg Thalheim
9e887c3201
add tests for flakes
2020-08-09 22:51:10 +01:00
Jörg Thalheim
7a5efc4080
make flake8 happy
2020-06-30 08:47:24 +01:00
Jörg Thalheim
9b5b553521
improve tests
2020-04-11 22:12:03 +01:00
Jörg Thalheim
862b772839
add tests
2020-04-01 16:12:48 +01:00