Giter VIP home page Giter VIP logo

pytest-interactive's People

Contributors

vodik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pytest-interactive's Issues

Overload Addition For tests

Allow tests and test nodes to be grouped through the + operator something like so

tests_set = tt.tests.some.tests + tt.some.other.tests

Update for IPython 5.0

The new prompts system in IPython 5.0 renders this unrunnable. Some other issues have prevented me getting a full PR for this, but the gist of what needs to change is that

    pm = ipshell.prompt_manager
    bold_prmpt = '{color.number}' '{tt}' '{color.prompt}'
    pm.in_template = "'{}' selected >>> ".format(bold_prmpt)
    # don't rjustify with preceding 'in' prompt
    pm.justify = False

Needs to be replaced with the new crap, and the basics for how to replace the input prompt would be to add on to the plugin.py with something like:

from IPython.terminal.prompts import Prompts, Token
...

class PytestPrompt(Prompts):
    def in_prompt_tokens(self, cli=None):
        return [
            (Token.Prompt, '{color.number}'),
            (Token.PromptNum, '{tt}'),
            (Token.Prompt, ' selected >>> '),
        ]


class PytestShellEmbed(InteractiveShellEmbed):
    """Custom ip shell with a slightly altered exit message
    """
    prompts_class = PytestPrompt
    ...

pip

Hi, thanks for your work, I find it superuseful.

Have you think in packaging it for pip? It would be nice to install from there.

INTERNALERROR> AttributeError: CaptureManager instance has no attribute 'suspendcapture'

Issue

$ docker-compose -f docker-compose.yml up
Recreating pctest1 ... done
Attaching to pctest1
pctest1 | ============================= test session starts ==============================
pctest1 | platform linux2 -- Python 2.7.17, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
pctest1 | rootdir: /opt/por/share/p1at/src/p1at/test_mods/sec7, inifile:
pctest1 | plugins: interactive-0.1.4
pctest1 | collected 1 item
pctest1 | INTERNALERROR> Traceback (most recent call last):
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/_pytest/main.py", line 105, in wrap_session
pctest1 | INTERNALERROR>     session.exitstatus = doit(config, session) or 0
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/_pytest/main.py", line 142, in _main
pctest1 | INTERNALERROR>     config.hook.pytest_collection(session=session)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 617, in __call__
pctest1 | INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 222, in _hookexec
pctest1 | INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 216, in <lambda>
pctest1 | INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 201, in _multicall
pctest1 | INTERNALERROR>     return outcome.get_result()
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 77, in get_result
pctest1 | INTERNALERROR>     _reraise(*ex)  # noqa
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 180, in _multicall
pctest1 | INTERNALERROR>     res = hook_impl.function(*args)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/_pytest/main.py", line 152, in pytest_collection
pctest1 | INTERNALERROR>     return session.perform_collect()
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/_pytest/main.py", line 685, in perform_collect
pctest1 | INTERNALERROR>     config=self.config, items=items)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 617, in __call__
pctest1 | INTERNALERROR>     return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 222, in _hookexec
pctest1 | INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/__init__.py", line 216, in <lambda>
pctest1 | INTERNALERROR>     firstresult=hook.spec_opts.get('firstresult'),
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 201, in _multicall
pctest1 | INTERNALERROR>     return outcome.get_result()
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 77, in get_result
pctest1 | INTERNALERROR>     _reraise(*ex)  # noqa
pctest1 | INTERNALERROR>   File "/usr/lib/python2.7/dist-packages/pluggy/callers.py", line 180, in _multicall
pctest1 | INTERNALERROR>     res = hook_impl.function(*args)
pctest1 | INTERNALERROR>   File "/usr/local/lib/python2.7/dist-packages/interactive/plugin.py", line 28, in pytest_collection_modifyitems
pctest1 | INTERNALERROR>     capman.suspendcapture(in_=True)
pctest1 | INTERNALERROR> AttributeError: CaptureManager instance has no attribute 'suspendcapture'
pctest1 | 
pctest1 | ========================= no tests ran in 0.86 seconds =========================
pctest1 exited with code 3

Environment

  • Pythons are listed in the output above.
  • Ubuntu 16.04

(yes some are EoL but our production is about to migrate to newer distro and Py3 :/)

Part of my docker-compose.yml

  command: /bin/bash -c "pytest --interactive -s /test.py"

Add unit tests

Basing these off the pytest unit tests probably makes the most sense. Not sure how to test the magics stuff offhand. Might have to look at the IPython test set.

This test trips up on documentation tests

I just hit

AttributeError: 'DoctestTextfile' object has no attribute '_obj'

Error is in line 102 in plugin.py. item is an instance of DoctestTextfile.

My mistake, py.test collected over the documentation folder... but it seems like the collection logic isn't exhaustive.

Add a `pytest.interact()` call to embed IPython

It would be handy if the embedded scope provided lazy access to all available upstream fixture values for introspection and debugging. Proper considerations should be made for disabling the capturemanager plugin as well.

Integrate with the pytest cache

@moises-silva mentioned that it would be handy to have a way to get a failed test's id spec from inside the debugger such that you can rerun just that test easily in the next pytest invocation using that id.

I was thinking we could add a pytest.get_test_id() or something similar which could aid with this but I'd really love to find a more elegant solution.

TestTree nodes should deliver test docs

Using the IPython tt.test_blah.test_foo? syntax for quickref-ing docs should give the documentation for all contained test nodes. Currently the TestSet docs are used which is not so useful. The whole point of this tool is to let you navigate the test set and figure out what you want to run...

pytest-interactive on python 2.6

I'm trying to install this plugin on python 2.6 and ipython 1.2.1.
i had to take out the requirement in setup.py for ipython because it was trying to upgrade and needless to say, i want to keep the versions i have.

Any help is greatly appreciated.

http://dpaste.com/2XG00B8

Thank You

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.