Merge pull request #3212 from RasmusWL/python-fix-tests-filter

Python: Fix (some) shortcomings of tests filter
This commit is contained in:
Taus
2020-04-27 11:26:35 +02:00
committed by GitHub
7 changed files with 29 additions and 12 deletions

View File

@@ -1,3 +1,6 @@
| Class MyTest |
| Function test_1 |
| Function test_2 |
| test.py:4:1:4:23 | Class MyTest |
| test.py:6:5:6:21 | Function test_1 |
| test.py:9:5:9:21 | Function test_2 |
| test_foo.py:3:1:3:15 | Function test_foo |
| unittest_test.py:3:1:3:33 | Class FooTest |
| unittest_test.py:4:5:4:25 | Function test_valid |

View File

@@ -2,4 +2,4 @@ import python
import semmle.python.filters.Tests
from TestScope t
select t.toString()
select t

View File

@@ -1,5 +1,3 @@
class TestCase:
pass

View File

@@ -0,0 +1,4 @@
# This is running under some unknown framework, but is clearly a test!
def test_foo():
assert True

View File

@@ -0,0 +1,5 @@
import unittest
class FooTest(unittest.TestCase):
def test_valid(self):
pass