Questions tagged [nose-parameterized]

Nose decorator for parameterized testing

nose-parameterized is a decorator for parameterized testing with nose Now with 100% less Python 3 incompatibility!

Nose. It's got test generators. But they kind of suck:

They often require a second function They make it difficult to separate the data from the test They don't work with subclases of unittest.TestCase kwargs? What kwargs? But nose-parameterized fixes many of these issues.

Documentation

9 questions
6
votes
3 answers

Python Testing how to run parameterised Testcases and pass a parameter to setupClass

I have an python unitest. In the setupClass method I so some timeconsuming tasks... The tests itself run very fast. Now i would like to run the same Testcase with multiple sets of parameters. How can I achieve this? I ve tried differet approaches…
3
votes
1 answer

skip only one parameter from the parameterized list in python nose-parameterized

As I understand, parameterized.expand([1, 2, 3]) will create three test cases. I would like to know how can I skip only one of them? I know that @unitest.skip() will skip the whole 3 test cases, I only wanna to skip one of them. Here is a simple…
IslamTaha
  • 1,056
  • 1
  • 10
  • 17
2
votes
2 answers

How to access class property in decorator in Python?

I am trying to use a nose_parameterized test and want to use it for a unittest method. from nose.tools import assert_equal from nose_parameterized import parameterized import unittest Class TestFoo(unittest.TestCase): def setUp(self): …
1
vote
1 answer

use class method in nose parameterize.expand call

I have a generator method that is building a large set of test criteria, I know i can make a non class method to be called, but I much rather have the parameter building method be part of my test class. is there a way to do this? here is a simple…
Nathan Tregillus
  • 6,006
  • 3
  • 52
  • 91
1
vote
1 answer

Run individual nose-parameterized tests

I am working on a Django project, and we are using nose-parameterized library. I can see all of the parameterized tests in the runner if I run the full class, but then if I try to run just by right clicking the test name, and clicking run or debug,…
Nathan Tregillus
  • 6,006
  • 3
  • 52
  • 91
0
votes
1 answer

Apply different decorators based on a condition

I'm using unittest and nose-parametarized, and want to apply different decorators to a test based on a condition. I have a test and I want to skip unittest.skip the test or execute it @parameterized.expand(args)based on the arguments passed to…
0
votes
1 answer

Print name of test function in nose_parametrized

I have test classes that extend unittest.TestCase, and use nose_parameterized for parameterization. I'm using nosetests -v to run the tests. I have nosetests version 1.3.7. I'd like the test runner to print the name of each test. Instead it just…
dinosaur
  • 3,164
  • 4
  • 28
  • 40
0
votes
1 answer

PyCharm errors for valid python code

I posted the following question regarding nose and parameterized tests: use-class-method-in-nose-parameterize.expand call and I got my answer, but now I wonder why PyCharm is failing to recognize this as valid code. Does anyone know how to turn off…
Nathan Tregillus
  • 6,006
  • 3
  • 52
  • 91
-3
votes
3 answers

How To Fix "TypeError: 'NoneType' object is not callable"

When I run my script: from selenium import webdriver # from selenium.webdriver.firefox.firefox_binary import FirefoxBinary from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import os import pytest import unittest from…
Glen
  • 15
  • 1
  • 4