Git Product home page Git Product logo

Comments (6)

joeyespo avatar joeyespo commented on August 11, 2024

👍 for tests. Pretty amusing that a testing tool has no tests, huh?

I don't think we need anything heavy though. We don't necessarily need randomized data to test the wire-up the ptw provides. All we really need is a tests/ directory with a few test_xx.py files and subdirectories that mimic real projects (e.g. some that include a pytest.ini to ensure that the config wire-up is working). It's boring, but it works.

from pytest-watch.

bendtherules avatar bendtherules commented on August 11, 2024

To clear myself, I didn't mean filling those files with randomised data, but more like filling necessary files like pytest.ini in a declarative manner, as possible in cloud-init.
Something like this

-tests/test_asd.py
-asd.py
-pytest.ini
    content:
    [pytest-watch]
    verbose = True

We can do it with just Python too, but I think that will be pretty boring, error-prone and more likely, we'll end up writing half-baked helpers for this. It is better that we choose a well-tested soln for this.

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

What advantage does that have over a literal file that contains the same thing?

tests/test-project/pytest.ini:

[pytest-watch]
verbose = True

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

Closing this because there's already an issue for tests and I don't plan to have any generated directories as of right now. I think having a directory of test projects is more stable, visible, and just as declarative as putting the same information into a config file.

On the other hand, the downside to having literal files instead of generated ones is that you can't combine cases as easily. I don't think it's a big advantage in this particular project since we can cover most ptw cases with just a few test projects. But if does become unwieldy, I'm definitely willing to use tools to help. Using them from the get-go is just too much of a pre-optimization.

Thanks for the suggestion, @bendtherules.

from pytest-watch.

bendtherules avatar bendtherules commented on August 11, 2024

You are right that it doesnt make much of a difference. I was just thinking that it will help generate the structure in a temporary directory to make sure improper tests dont dirty the actual directories, but maybe we can just copy it over to get the same effect.

from pytest-watch.

joeyespo avatar joeyespo commented on August 11, 2024

@bendtherules Oh yes, that's a good point. The technique I've been using is to use temp directories for that purpose, copying files over like you're suggesting. Not all tests will require file changes though, so some tests can function without the extra overhead. Luckily, git will let us see if we accidently set up tests that write to those "read-only" directories.

from pytest-watch.

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.