Skip to content

Commit

Permalink
[test][NFC] Change from nose to pytest (tools library)
Browse files Browse the repository at this point in the history
Continuation of Ericsson#3926.
  • Loading branch information
Szelethus committed Jun 7, 2023
1 parent 31ba5fb commit 88c1731
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 10 deletions.
2 changes: 1 addition & 1 deletion tools/bazel/requirements_py/dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose==1.3.7
pytest==7.3.1
pycodestyle==2.7.0
pylint==2.8.2
mypy==0.812
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose==1.3.7
pytest==7.3.1
pycodestyle==2.7.0
pylint==2.8.2
portalocker==2.2.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ class TestCmdline(unittest.TestCase):

def test_help(self):
""" Get help for report-converter tool. """
ret = subprocess.call(['report-converter', '--help'])
ret = subprocess.call(['report-converter', '--help'],
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
self.assertEqual(0, ret)

def test_metadata(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ def test_report_to_gerrit_conversion(self):
]
},
}
self.assertEquals(res, expected)
self.assertEqual(res, expected)

def test_report_to_gerrit_conversion_abs_filepath(self):
""" Conversion report with absolute filepath. """
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_report_to_gerrit_conversion_abs_filepath(self):
]
},
}
self.assertEquals(res, expected)
self.assertEqual(res, expected)

def test_report_to_gerrit_conversion_report_url(self):
""" Conversion report with absolute filepath and CC_REPORT_URL env. """
Expand Down Expand Up @@ -127,7 +127,7 @@ def test_report_to_gerrit_conversion_report_url(self):
]
},
}
self.assertEquals(res, expected)
self.assertEqual(res, expected)

def test_report_to_gerrit_conversion_filter_changed_files(self):
"""Conversion report with changed files filter.
Expand Down Expand Up @@ -173,10 +173,10 @@ def test_report_to_gerrit_conversion_filter_changed_files(self):
review_comments = res["comments"]

# Reports were found in two source files.
self.assertEquals(len(review_comments), 1)
self.assertEqual(len(review_comments), 1)

# Two reports in the main.cpp file.
self.assertEquals(len(review_comments[report.file.path]), 2)
self.assertEqual(len(review_comments[report.file.path]), 2)

self.assertIn(
"CodeChecker found 3 issue(s) in the code.", res["message"])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@
macro_expansions=[])


class PlistParserTestCaseNose(unittest.TestCase):
class PlistParserTestCase(unittest.TestCase):
"""Test the parsing of the plist generated by multiple clang versions."""

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion tools/tu_collector/requirements_py/dev/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
nose==1.3.7
pytest==7.3.1
pycodestyle==2.7.0
pylint==2.8.2
mypy==0.812
Expand Down

0 comments on commit 88c1731

Please sign in to comment.