Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Doing per-test fixtures? #15

Closed
jkugler opened this issue Jun 15, 2015 · 2 comments
Closed

Doing per-test fixtures? #15

jkugler opened this issue Jun 15, 2015 · 2 comments

Comments

@jkugler
Copy link

jkugler commented Jun 15, 2015

I came across this project today, and it appears to be exactly what I want. There is one feature that would make life a little easier for me. If this feature is there, please forgive intrusion (I haven't looked at the code).

Is there a way to specify the yaml/json file(s) per test? I have several tests involving the User class, for example, but don't want the same set of records for each test. I'd rather not have a proliferation of TestClasses just because I need different fixtures.

Thanks!

And if I missed anything about a mailing list, I apologize.

@croach
Copy link
Owner

croach commented Jun 16, 2015

Hi @jkugler,

Right now the library doesn't support different fixtures files for each test. That is about to change though. I have two Issues that I created that deal with running fixtures on a per test basis (Issue #2 and Issue #6). You can read through them if you're interested, but the short version is that the first version of Flask-Fixtures used decorator functions instead of metaclasses to specify the class and/or method that you wanted to run fixtures on. This had problems with how the library interacted with custom setUp and tearDown methods, so I had to change the overall design of the library to use a combination of metaclasses and decorators instead. I've finished the first part of fixing these bugs, i.e., the switch to metaclasses, but I haven't yet finished the second part, i.e., making it possible to select a fixtures file for each individual test function. I'm working on the second part now though, and it should be finished very soon, so keep your eyes peeled and thanks for using the library!

Christopher

@jkugler
Copy link
Author

jkugler commented Jun 16, 2015

Sounds great! I look forward to seeing the enhancements.

@jkugler jkugler closed this as completed Jun 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants