Giter Club home page Giter Club logo

Comments (6)

Arrowana avatar Arrowana commented on August 24, 2024 1

Yes, you can.

For instance:

import unittest

from ddt import ddt, data

@ddt
class ThingTest(unittest.TestCase):

	@data(3, 4, 5)
	def test_equal(self, n):
		self.assertEqual(4, n)

When running discovery you get the following test methods:
test_stuff.ThingTest.test_equal_1_3
test_stuff.ThingTest.test_equal_2_4
test_stuff.ThingTest.test_equal_3_5

To run one:
python -m unittest test_stuff.ThingTest.test_equal_2_4

However, I don't know why your command syntax does not work

from ddt.

tadly avatar tadly commented on August 24, 2024 1

Just wanted to say that I myself have migrated to pytest so I won't be spending much time on this issue.
But good to see that it has been acknowledged :)

from ddt.

wswld avatar wswld commented on August 24, 2024

I can confirm the syntax suggested by @tadly is not supported at the moment, the right way to use it is like shown by @Arrowana. It's a bummer since discovering tests by substring would be most beneficial.

If anyone has a vision how this could be implemented, a pull request is welcome. I will probably investigate it at some point but for now there are more pressing issues with this package.

from ddt.

avkoval avatar avkoval commented on August 24, 2024

When running discovery

How to run 'discovery'? I can't find the option into nose how to do that, without it the method names are hidden :-(

from ddt.

avkoval avatar avkoval commented on August 24, 2024

I found one workaround: if I comment out docstring of the test function, I can see the function name: that is the only way I found to discover that - anything else (-v 3, etc) does no help

from ddt.

wswld avatar wswld commented on August 24, 2024

from ddt.

Related Issues (20)

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.