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

PR: Move all tests to be pytest's #4199

Merged
merged 22 commits into from
Mar 13, 2017

Conversation

dalthviz
Copy link
Member

Fixes #3195

@dalthviz dalthviz added this to the v3.1.4 milestone Feb 24, 2017
@dalthviz dalthviz self-assigned this Feb 24, 2017
@dalthviz dalthviz changed the title [WIP]: Test from widgets to the test folder PR: Test from widgets to the test folder Feb 25, 2017
@ccordoba12
Copy link
Member

Please remove all commits related to formlayout. I think we don't use it anywhere in our code, and we probably should remove it (in 3.2, I think).

@ccordoba12 ccordoba12 changed the title PR: Test from widgets to the test folder PR: Move all tests to be pytest's Mar 1, 2017
@ccordoba12
Copy link
Member

@dalthviz, is this ready?

@dalthviz
Copy link
Member Author

dalthviz commented Mar 3, 2017

@ccordoba12 I think that there are some more tests to be moved in utils and app directories.

@dalthviz dalthviz requested review from ccordoba12 and goanpeca March 6, 2017 05:25
@ccordoba12
Copy link
Member

@dalthviz, please remove all real tests (i.e. the ones that contain assert statements) in files that are not widgets.

That would be the last thing to do before merging this one. Great work, as always!!

@ccordoba12
Copy link
Member

@dalthviz, is this one ready?

@dalthviz
Copy link
Member Author

@ccordoba12 yes I think so 👍

def test_fallback_plugin():
"""Test the fallback plugin."""
p = FallbackPlugin()
print(FALLBACK_PLUGIN_FILE)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove print

get_preferred_submodules)
from spyder.py3compat import PY3

def test_codeanalysis():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to test_modulecompletion

if not len(args) == 2:
return
plugin = PluginServer(*args)
qtbot.addWidget(plugin)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

plugin_server is not a Qt widget. Please fix this.

# Local imports
from spyder.utils.introspection.utils import CodeInfo

def test_codeanalysis():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change this to test_codeinfo


def test_dochelpers():
"""Test dochelpers."""
class Test(object):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move this class out of the test definition

'in descending order.',
'name': 'sorted'}
assert getargtxt(sorted) == None
assert isdefined('numpy.take', force_import=True) == True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no need to assert ... == True. You can change this simply to assert ...

'name': 'sorted'}
assert getargtxt(sorted) == None
assert isdefined('numpy.take', force_import=True) == True
assert isdefined('__import__') == True
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove True

assert getargtxt(sorted) == None
assert isdefined('numpy.take', force_import=True) == True
assert isdefined('__import__') == True
assert isdefined('.keys', force_import=True) == False
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

assert not ... and remove False

@ccordoba12
Copy link
Member

The failure in CircleCI is caused by me. Don't worry about it :-)

get_preferred_submodules)
from spyder.py3compat import PY3

def test_codeanalysis():
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test_codeanalysis -> test_module_completion

@ccordoba12
Copy link
Member

Please merge with 3.1.x and solve the little error I mentioned above.

@ccordoba12 ccordoba12 merged commit cea8d2c into spyder-ide:3.1.x Mar 13, 2017
ccordoba12 added a commit that referenced this pull request Mar 13, 2017
ccordoba12 added a commit that referenced this pull request Mar 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants