diff --git a/Makefile b/Makefile index f47c50032f83c..1fdd3cfdcf027 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY : develop build clean clean_pyc doc lint-diff black +.PHONY : develop build clean clean_pyc doc lint-diff black test-scripts all: develop @@ -25,3 +25,6 @@ doc: cd doc; \ python make.py clean; \ python make.py html + +test-scripts: + pytest scripts diff --git a/scripts/__init__.py b/scripts/__init__.py new file mode 100644 index 0000000000000..e69de29bb2d1d diff --git a/scripts/tests/test_inconsistent_namespace_check.py b/scripts/tests/test_inconsistent_namespace_check.py index cc3509af5b138..9562a30ba0ffd 100644 --- a/scripts/tests/test_inconsistent_namespace_check.py +++ b/scripts/tests/test_inconsistent_namespace_check.py @@ -1,6 +1,6 @@ import pytest -from scripts.check_for_inconsistent_pandas_namespace import ( +from ..check_for_inconsistent_pandas_namespace import ( check_for_inconsistent_pandas_namespace, ) diff --git a/scripts/tests/test_validate_docstrings.py b/scripts/tests/test_validate_docstrings.py index 74819db7b878c..7e4c68ddc183b 100644 --- a/scripts/tests/test_validate_docstrings.py +++ b/scripts/tests/test_validate_docstrings.py @@ -2,7 +2,8 @@ import textwrap import pytest -import validate_docstrings + +from .. import validate_docstrings class BadDocstrings: @@ -162,7 +163,9 @@ def test_bad_class(self, capsys): ( "BadDocstrings", "indentation_is_not_a_multiple_of_four", - ("flake8 error: E111 indentation is not a multiple of four",), + # with flake8 3.9.0, the message ends with four spaces, + # whereas in earlier versions, it ended with "four" + ("flake8 error: E111 indentation is not a multiple of ",), ), ( "BadDocstrings", diff --git a/scripts/tests/test_validate_unwanted_patterns.py b/scripts/tests/test_validate_unwanted_patterns.py index 947666a730ee9..ef93fd1d21981 100644 --- a/scripts/tests/test_validate_unwanted_patterns.py +++ b/scripts/tests/test_validate_unwanted_patterns.py @@ -1,7 +1,8 @@ import io import pytest -import validate_unwanted_patterns + +from .. import validate_unwanted_patterns class TestBarePytestRaises: