Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing skips #2861

Open
jayvdb opened this issue Feb 6, 2019 · 6 comments
Open

Add missing skips #2861

jayvdb opened this issue Feb 6, 2019 · 6 comments

Comments

@jayvdb
Copy link
Member

jayvdb commented Feb 6, 2019

Tests should skip if dependencies are missing. Currently all python deps are pre-installed, but

  1. we want to change that
  2. in distro packaging, that isnt always feasible as some packages may not be possible/ready/compatible.
[   83s] _________ ERROR collecting tests/c_languages/ArtisticStyleBearTest.py __________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/ArtisticStyleBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ____________ ERROR collecting tests/c_languages/CPPCheckBearTest.py ____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/CPPCheckBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ____________ ERROR collecting tests/c_languages/CPPCleanBearTest.py ____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/CPPCleanBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ____________ ERROR collecting tests/c_languages/CPPLintBearTest.py _____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/CPPLintBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ___________ ERROR collecting tests/c_languages/CSecurityBearTest.py ____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/CSecurityBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ___________ ERROR collecting tests/c_languages/CSharpLintBearTest.py ___________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/CSharpLintBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] _____________ ERROR collecting tests/c_languages/ClangBearTest.py ______________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/ClangBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ________ ERROR collecting tests/c_languages/ClangComplexityBearTest.py _________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/ClangComplexityBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ___________ ERROR collecting tests/c_languages/GNUIndentBearTest.py ____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/GNUIndentBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s]  ERROR collecting tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/ClangASTPrintBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s]  ERROR collecting tests/c_languages/codeclone_detection/ClangCloneDetectionBearTest.py
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/ClangCloneDetectionBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s]  ERROR collecting tests/c_languages/codeclone_detection/ClangCountVectorCreatorTest.py
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/ClangCountVectorCreatorTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s]  ERROR collecting tests/c_languages/codeclone_detection/ClangCountingConditionsTest.py
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/ClangCountingConditionsTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s]  ERROR collecting tests/c_languages/codeclone_detection/CloneDetectionRoutinesTest.py
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/CloneDetectionRoutinesTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] __ ERROR collecting tests/c_languages/codeclone_detection/CountVectorTest.py ___
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/c_languages/codeclone_detection/CountVectorTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/c_languages/__init__.py:3: in <module>
[   83s]     from clang.cindex import Index, LibclangError
[   83s] E   ModuleNotFoundError: No module named 'clang'
[   83s] ______________ ERROR collecting tests/general/MementoBearTest.py _______________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/general/MementoBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/general/MementoBearTest.py:8: in <module>
[   83s]     from bears.general.MementoBear import MementoBear
[   83s] bears/general/MementoBear.py:11: in <module>
[   83s]     from memento_client import MementoClient
[   83s] E   ModuleNotFoundError: No module named 'memento_client'
[   83s] _______ ERROR collecting tests/natural_language/LanguageToolBearTest.py ________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/natural_language/LanguageToolBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/natural_language/LanguageToolBearTest.py:7: in <module>
[   83s]     from bears.natural_language.LanguageToolBear import LanguageToolBear
[   83s] bears/natural_language/LanguageToolBear.py:4: in <module>
[   83s]     from guess_language import guess_language
[   83s] E   ModuleNotFoundError: No module named 'guess_language'
[   83s] _______________ ERROR collecting tests/python/BanditBearTest.py ________________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/BanditBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/BanditBearTest.py:13: in <module>
[   83s]     import bandit
[   83s] E   ModuleNotFoundError: No module named 'bandit'
[   83s] ____________ ERROR collecting tests/python/PEP8NotebookBearTest.py _____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/PEP8NotebookBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/PEP8NotebookBearTest.py:2: in <module>
[   83s]     from bears.python.PEP8NotebookBear import PEP8NotebookBear
[   83s] bears/python/PEP8NotebookBear.py:2: in <module>
[   83s]     import nbformat
[   83s] E   ModuleNotFoundError: No module named 'nbformat'
[   83s] ___________ ERROR collecting tests/python/PyCommentedCodeBearTest.py ___________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/PyCommentedCodeBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/PyCommentedCodeBearTest.py:3: in <module>
[   83s]     from bears.python.PyCommentedCodeBear import PyCommentedCodeBear
[   83s] bears/python/PyCommentedCodeBear.py:1: in <module>
[   83s]     import eradicate
[   83s] E   ModuleNotFoundError: No module named 'eradicate'
[   83s] _______________ ERROR collecting tests/python/PyromaBearTest.py ________________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/PyromaBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/PyromaBearTest.py:6: in <module>
[   83s]     from bears.python.PyromaBear import PyromaBear
[   83s] bears/python/PyromaBear.py:2: in <module>
[   83s]     import pyroma
[   83s] E   ModuleNotFoundError: No module named 'pyroma'
[   83s] ________ ERROR collecting tests/python/requirements/PySafetyBearTest.py ________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/requirements/PySafetyBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/requirements/PySafetyBearTest.py:4: in <module>
[   83s]     from safety.safety import Vulnerability
[   83s] E   ModuleNotFoundError: No module named 'safety'
[   83s] __ ERROR collecting tests/python/requirements/PySafetyBearWithoutMockTest.py ___
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/python/requirements/PySafetyBearWithoutMockTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/python/requirements/PySafetyBearWithoutMockTest.py:4: in <module>
[   83s]     from bears.python.requirements.PySafetyBear import PySafetyBear
[   83s] bears/python/requirements/PySafetyBear.py:6: in <module>
[   83s]     from safety import safety
[   83s] E   ModuleNotFoundError: No module named 'safety'
[   83s] _______________ ERROR collecting tests/rest/reSTLintBearTest.py ________________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/rest/reSTLintBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/rest/reSTLintBearTest.py:1: in <module>
[   83s]     from bears.rest.reSTLintBear import reSTLintBear
[   83s] bears/rest/reSTLintBear.py:1: in <module>
[   83s]     from restructuredtext_lint import lint
[   83s] E   ModuleNotFoundError: No module named 'restructuredtext_lint'
[   83s] _________________ ERROR collecting tests/vcs/CommitBearTest.py _________________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/CommitBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/CommitBearTest.py:7: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
[   83s] ___________ ERROR collecting tests/vcs/git/CISkipInspectBearTest.py ____________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/git/CISkipInspectBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/git/CISkipInspectBearTest.py:17: in <module>
[   83s]     from .GitCommitBearTest import GitCommitBearTest
[   83s] tests/vcs/git/GitCommitBearTest.py:12: in <module>
[   83s]     from bears.vcs.git.GitCommitBear import GitCommitBear
[   83s] bears/vcs/git/GitCommitBear.py:5: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
[   83s] _____________ ERROR collecting tests/vcs/git/GitCommitBearTest.py ______________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/git/GitCommitBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/git/GitCommitBearTest.py:12: in <module>
[   83s]     from bears.vcs.git.GitCommitBear import GitCommitBear
[   83s] bears/vcs/git/GitCommitBear.py:5: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
[   83s] __________ ERROR collecting tests/vcs/git/GitLinearCommitBearTest.py ___________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/git/GitLinearCommitBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/git/GitLinearCommitBearTest.py:16: in <module>
[   83s]     from .GitCommitBearTest import GitCommitBearTest
[   83s] tests/vcs/git/GitCommitBearTest.py:12: in <module>
[   83s]     from bears.vcs.git.GitCommitBear import GitCommitBear
[   83s] bears/vcs/git/GitCommitBear.py:5: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
[   83s] __________ ERROR collecting tests/vcs/git/GitRevertInspectBearTest.py __________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/git/GitRevertInspectBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/git/GitRevertInspectBearTest.py:17: in <module>
[   83s]     from .GitCommitBearTest import GitCommitBearTest
[   83s] tests/vcs/git/GitCommitBearTest.py:12: in <module>
[   83s]     from bears.vcs.git.GitCommitBear import GitCommitBear
[   83s] bears/vcs/git/GitCommitBear.py:5: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
[   83s] ___________ ERROR collecting tests/vcs/mercurial/HgCommitBearTest.py ___________
[   83s] ImportError while importing test module '/home/abuild/rpmbuild/BUILD/coala-bears-0.12.0.dev0+git1.g4a1ccfb/tests/vcs/mercurial/HgCommitBearTest.py'.
[   83s] Hint: make sure your test modules/packages have valid Python names.
[   83s] Traceback:
[   83s] tests/vcs/mercurial/HgCommitBearTest.py:11: in <module>
[   83s]     from bears.vcs.mercurial.HgCommitBear import HgCommitBear
[   83s] bears/vcs/mercurial/HgCommitBear.py:4: in <module>
[   83s]     from bears.vcs.CommitBear import _CommitBear
[   83s] bears/vcs/CommitBear.py:9: in <module>
[   83s]     from giturlparse import parse
[   83s] E   ModuleNotFoundError: No module named 'giturlparse'
@Daronion
Copy link
Contributor

Daronion commented Feb 8, 2019

What does skip test exactly mean?

  • should the test appear as done, or should it just not appear in the output?
  • what happens to the coverage in the case of skipped tests?

Is it okay for me to be assigned to this issue?

@Daronion
Copy link
Contributor

Daronion commented Feb 8, 2019

After further investigation I noticed that there exists a dependency check already in place. The problem is caused by the imports (happening at bear declaration time) taking place before the actual dependency check.

I thought of 2 possible solutions:

  1. Each bear can define a function that imports its dependencies.
    Before
...
import nltk
...
from giturlparse import parse
...
class _CommitBear(GlobalBear):
    ...

After

...
class _CommitBear(GlobalBear):
    def import_dependencies(self):
        import nltk
        from giturlparse import parse
    ...
  1. We can use python decorators to avoid class declaration if dependencies are not met.

Nevertheless this issues seems like it needs discussing.

@jayvdb
Copy link
Member Author

jayvdb commented Feb 8, 2019

@Daronion , see other test classes in the bears repo, and you should see a skip decorator used on them. The log of errors probably contains quite a few different sorts of problems, so focus on MementoBear, PEP8NotebookBear, PySafetyBear, PyromaBear, EradicateBear, and others which have the same type of problem as those ones.

We'll move the clang and giturlparse ones to a new issue.

@Daronion
Copy link
Contributor

Daronion commented Feb 10, 2019

@jayvdb , I looked at other classes and found the generate_skip_decorator. I focused on MementoBear and noticed the following:
it has a dependency on URLHeadBear, and URLHeadBear has a dependency on URLBear. All 3 tests (MementoBearTest, URLHeadBearTest, URLBearTest) fail because the last dependency (URLBear) requires aenum which doesn't exist so it should be skipped.

I tried adding the skip decorator on each test with the URLBear as argument, since I knew its REQUIREMENTS were not met, which meant all 3 tests should have been skipped. However i still get the same error.
- I know the skip decorator should take as argument the same bear that refers to the actual test, I just forced it to check if it works.

I think the problem remains the same. For the errors to show up it means the tests don't reach the skip decorator part at all. The errors take place right at the beginning of the test, when the import happens. URLHeadBear and MementoBear are being imported with no check of their requirements taking place.

This means we need to import the bears in the test files after a dependency check which brings me back to my previews post.

@jayvdb
Copy link
Member Author

jayvdb commented Feb 10, 2019

You need to ignore any test file where the failing import appears in the test suite.

The analysis that you are doing is useful, and you appear to be going in the right direction, but there are two types of import errors and you need to keep going until you understand them both. Keeping looking through the list of errors, especially for PEP8NotebookBear, PySafetyBear, PyromaBear, EradicateBear which I mentioned earlier.

@Daronion
Copy link
Contributor

I checked on each of the bears mentioned (I couldn't find the EradicateBear though, maybe you mean the eradicate module from PyCommentedCodeBear).

  • PEP8NotebookBearTest:
    [ 83s] Traceback:
    [ 83s] tests/python/PEP8NotebookBearTest.py:2: in
    [ 83s] from bears.python.PEP8NotebookBear import PEP8NotebookBear
    [ 83s] bears/python/PEP8NotebookBear.py:2: in
    [ 83s] import nbformat

At the beginning of this test , without any dependency checks the PEP8NotebookBear is imported and in the PEP8NotebookBear we are importing nbformat which doesn't exist.

The same goes for all of the other bears, as their tests import them in the beginning of their files after which they import files that might not exist leading to errors.

From what I see the problem is the same. It seems to me as if there is a single type of import error taking place every time so if you could help me figure out what the second type of import error is that would be great.

Also I think I have an idea of how to fix the current import error that occurs on every bear test.
Since we know the problem occurs at the start of every test where we import bears with no dependency check in place, we can create a function for each different bear import that simply imports the bear, after which we simply decorate these functions with the already existing skip decorator.

From:

from coalib.testing.LocalBearTestHelper import verify_local_bear
from bears.python.PEP8NotebookBear import PEP8NotebookBear
...

To:

from coalib.testing.LocalBearTestHelper import verify_local_bear
from coalib.testing.BearTestHelper import generate_skip_decorator

@generate_skip_decorator(PEP8NotebookBear)
def import_PEP8NotebookBear():
    from bears.python.PEP8NotebookBear import PEP8NotebookBear

If the problem is a different one please explain it to me since I don't see any different types of import errors taking place other than the one described above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

3 participants