Code Monkey home page Code Monkey logo

nose2django's People

Contributors

bretth avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

nose2django's Issues

nose2django does not work with Django 1.6.1

Traceback (most recent call last):
  File "/home/omer/.virtualenvs/restapi/bin/nose2", line 9, in <module>
    load_entry_point('nose2==0.5.0', 'console_scripts', 'nose2')()
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2/main.py", line 284, in discover
    return main(*args, **kwargs)
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2/main.py", line 98, in __init__
    super(PluggableTestProgram, self).__init__(**kw)
  File "/home/omer/.pyenv/versions/2.7.4/lib/python2.7/unittest/main.py", line 95, in __init__
    self.runTests()
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2/main.py", line 260, in runTests
    self.result = runner.run(self.test)
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2/runner.py", line 45, in run
    self.session.hooks.startTestRun(event)
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2/events.py", line 224, in __call__
    result = getattr(plugin, self.method)(event)
  File "/home/omer/.virtualenvs/restapi/lib/python2.7/site-packages/nose2django/nose2django.py", line 20, in startTestRun
    from django.test.simple import reorder_suite, DjangoTestSuiteRunner
ImportError: cannot import name reorder_suite

Setup the database and test environment on runner creation instead of before testing

Since the Such DSL does not allow using the parameters plugin yet (See nose-devs/nose2#139) I am forced to do the following:

with such.A('foo') as it:

  for foo in Foo.objects.all(): # Gets objects from real database
    @it.should("do bar for foo (#%d)" % foo.id)
        def do_bar(case):
          # use foo here
          foo.bar() # uses the test database.

  it.createTests(globals()) 

I'd rather have the database setup on runner creation if possible.

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.