Skip to content

Commit

Permalink
Adding pytest-specific files
Browse files Browse the repository at this point in the history
  • Loading branch information
petdance committed Dec 31, 2024
1 parent 9e78fce commit 979b990
Show file tree
Hide file tree
Showing 9 changed files with 69 additions and 1 deletion.
3 changes: 3 additions & 0 deletions t/ack-f.t
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ DEFAULT_DIR_EXCLUSIONS: {
t/swamp/example.R
t/swamp/file.bar
t/swamp/file.foo
t/swamp/foo_test.py
t/swamp/fresh.css
t/swamp/groceries/another_subdir/fruit
t/swamp/groceries/another_subdir/junk
Expand Down Expand Up @@ -62,6 +63,8 @@ DEFAULT_DIR_EXCLUSIONS: {
t/swamp/sample.rake
t/swamp/service.svc
t/swamp/stuff.cmake
t/swamp/test_foo.py
t/swamp/test.py
t/swamp/CMakeLists.txt
t/swamp/swamp/ignoreme.txt
),
Expand Down
6 changes: 6 additions & 0 deletions t/ack-k.t
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,9 @@ subtest 'More testing' => sub {
t/swamp/fresh.css
t/swamp/lua-shebang-test
t/swamp/notes.md
t/swamp/test.py
t/swamp/test_foo.py
t/swamp/foo_test.py
);

my @files_no_perl = qw(
Expand All @@ -106,6 +109,9 @@ subtest 'More testing' => sub {
t/swamp/fresh.css
t/swamp/lua-shebang-test
t/swamp/notes.md
t/swamp/test.py
t/swamp/test_foo.py
t/swamp/foo_test.py
);


Expand Down
3 changes: 3 additions & 0 deletions t/default-filter.t
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ filter_test(
't/swamp/example.R',
't/swamp/file.bar',
't/swamp/file.foo',
't/swamp/foo_test.py',
't/swamp/fresh.css',
't/swamp/fresh.min.css',
't/swamp/fresh.css.min',
Expand Down Expand Up @@ -58,6 +59,8 @@ filter_test(
't/swamp/sample.aspx',
't/swamp/sample.rake',
't/swamp/service.svc',
't/swamp/test.py',
't/swamp/test_foo.py',
't/swamp/__pycache__/notes.pl',
't/swamp/blib/ignore.pm',
't/swamp/blib/ignore.pod',
Expand Down
3 changes: 3 additions & 0 deletions t/file-iterator.t
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ UNFILTERED: {
t/swamp/favicon.ico
t/swamp/file.bar
t/swamp/file.foo
t/swamp/foo_test.py
t/swamp/fresh.css
t/swamp/fresh.css.min
t/swamp/fresh.min.css
Expand Down Expand Up @@ -114,6 +115,8 @@ UNFILTERED: {
t/swamp/service.svc
t/swamp/solution8.tar
t/swamp/stuff.cmake
t/swamp/test.py
t/swamp/test_foo.py
t/swamp/CMakeLists.txt
t/swamp/swamp/ignoreme.txt
),
Expand Down
34 changes: 33 additions & 1 deletion t/filetype-detection.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use strict;
use warnings;

use Test::More tests => 3;
use Test::More tests => 5;

use lib 't';
use Util;
Expand Down Expand Up @@ -50,5 +50,37 @@ subtest 'ASP.NET' => sub {
sets_match( \@results, \@expected, __FILE__ );
};


subtest Python => sub {
my @expected = qw(
t/swamp/test.py
t/swamp/foo_test.py
t/swamp/test_foo.py
);

my @args = qw( -f -t python t/swamp );
ack_sets_match( [ @args ], \@expected, 'With -t python' );

@args = qw( -f --python t/swamp );
ack_sets_match( [ @args ], \@expected, 'With --python' );
};


subtest Pytest => sub {
my @expected = qw(
t/swamp/foo_test.py
t/swamp/test_foo.py
);

my @args = qw( -f -t pytest t/swamp );
ack_sets_match( [ @args ], \@expected, 'With -t pytest' );

@args = qw( -f --pytest t/swamp );
ack_sets_match( [ @args ], \@expected, 'With --pytest' );
};


done_testing();


exit 0;
3 changes: 3 additions & 0 deletions t/inverted-file-filter.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ EXCLUDE_ONLY: {
t/swamp/example.R
t/swamp/file.bar
t/swamp/file.foo
t/swamp/foo_test.py
t/swamp/fresh.css
t/swamp/groceries/another_subdir/fruit
t/swamp/groceries/another_subdir/junk
Expand Down Expand Up @@ -49,6 +50,8 @@ EXCLUDE_ONLY: {
t/swamp/sample.rake
t/swamp/service.svc
t/swamp/stuff.cmake
t/swamp/test.py
t/swamp/test_foo.py
t/swamp/CMakeLists.txt
t/swamp/swamp/ignoreme.txt
),
Expand Down
6 changes: 6 additions & 0 deletions t/swamp/foo_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# foo_test.py IS a pytest test, as well as Python.

code = 0

# This should fail
assert code == 1
6 changes: 6 additions & 0 deletions t/swamp/test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# test.py is NOT a pytest test, but is Python.

code = 0

# This should fail
assert code == 1
6 changes: 6 additions & 0 deletions t/swamp/test_foo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# test_foo.py IS a pytest test, as well as Python.

code = 0

# This should fail
assert code == 1

0 comments on commit 979b990

Please sign in to comment.