DeZLearnsPCs
DeZLearnsPCs

Reputation: 81

Should I create a new .py script for unit tests?

I have written a Python script for parsing and validating XML files against an .XSD schema (and some other constraints), and I am about to write tests for it. I was thinking of using Python's unittest because it is built in and has assertions that I am familiar with. I have never tested with Python before, but have done JUnit testing with Java. I was wondering if I should create a new .py script for the tests?

Upvotes: 0

Views: 98

Answers (1)

AKX
AKX

Reputation: 168824

I suggest using Py.test instead of the built-in unittest module -- it's way more ergonomic.

With Py.test, you'd have a separate test_foo.py file (it discovers test-containing files by default by a test_ prefix).

Upvotes: 1

Related Questions