Coder Social home page Coder Social logo

cookiecutter-pytest-plugin's People

Contributors

abusalimov avatar asottile avatar bluetech avatar cclauss avatar gh-ppolk avatar gitter-badger avatar hackebrot avatar hugovk avatar ktosiek avatar luzfcb avatar m0dm avatar m1troll avatar matrixise avatar nicoddemus avatar obestwalter avatar omarkohl avatar pelme avatar rciorba avatar ronnie-llamado avatar s0undt3ch avatar stranger6667 avatar the-compiler avatar tjsmart avatar xuhdev avatar yashtodi94 avatar yukihiko-shinoda avatar zac-hd avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cookiecutter-pytest-plugin's Issues

.travis.yml doesn't run flake8

Having travis (or appveyor) be able to lint my code and any pull requests as part of a contribution is important, and the current templates do not accounts for a flake8 test env.

Custom hooks

  • Define hooks
  • Register them
  • Implement them

This should be a choice in cookiecutter.json.

Tests do not work

After installing and creating the plugin structure, I try to run original tests, that ship with plugin template. But that does not work.

For example, one of the tests cannot find default bar fixture, and I have this error:

Снимок экрана 2020-01-25 в 23 33 44

Also, testdir.makeini does not create any params.

I have pytest version 5.3.4 and python 3.8.0.

Use src layout

Thank you for the very handy template! Just a curiosity I guess, I created my package, pytest-blah, and there's a source file in the root (pytest_blah.py) along with setup.py etc. When I run python setup.py develop the root containing these files is added to my path, so I can do things like import setup or import pytest_blah directly (I've tried this from outside the root so it's not just a current directory thing).

Have I done something wrong or is that how it's supposed to be? Seems weird to have things like setup.py importable when the package is installed. I ended up making a pytest_blah directory, moving everything from pytest_blah.py into pytest_blah/init.py and putting all the other source files in there and it works as I expect.

EDIT: short example of what I mean: https://gist.github.com/danmur/0489969229281165424b0044f4236b92

Using -f with this template yields wrong results for docs

Due to cookiecutter/cookiecutter#458 repeatedly running the same cookiecutter with -f leads to this behaviour:

(tox) 13:55:53 ob@h2g2 [1] < ~/do/tox-dev >  914 %
rm -rf pytest-foobaz
(tox) 13:56:05 ob@h2g2 [0] < ~/do/tox-dev >  915 %
cookiecutter -f --replay cookiecutter-pytest-plugin
INFO:post_gen_project:Moving files for mkdocs.
INFO:post_gen_project:Removing all temporary license files
INFO:post_gen_project:Removing jinja2 macros
(tox) 13:56:07 ob@h2g2 [0] < ~/do/tox-dev >  916 %
cookiecutter -f --replay cookiecutter-pytest-plugin
INFO:post_gen_project:Moving files for mkdocs.
INFO:post_gen_project:Removing all temporary license files
INFO:post_gen_project:Removing jinja2 macros
(tox) 13:56:09 ob@h2g2 [0] < ~/do/tox-dev >  917 %
cookiecutter -f --replay cookiecutter-pytest-plugin
INFO:post_gen_project:Moving files for mkdocs.
Traceback (most recent call last):
  File "/tmp/tmp1np2t72r.py", line 16, in <module>
    shutil.move('mkdocs', 'docs')
  File "/usr/lib/python3.6/shutil.py", line 542, in move
    raise Error("Destination path '%s' already exists" % real_dst)
shutil.Error: Destination path 'docs/mkdocs' already exists
ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
Hook script failed (exit status: 1)

The first time the project is created and all is fine. The second time around the mkdocs folder is copied into the already existing docs folder therefore doing something wrong but not complaining yet. the third time around it crashes because it tries to write again into the wrong subfolder.

Add an option "Other" to licenses

Right now there is only three options of license, there should be a new named "other", so the user could type the license that he/she wants

Transition from testdir to pytester

According to the API docs, as of pytest 6.2, the use of testdir is discouraged in favor of the new pytester instance ("New code should avoid using testdir in favor of pytester"). This project should consider updating to comply with the new recommendation.

I grepped my local copy of this repo, and I believe it only references the old 'testdir instance in the file "test_{{cookiecutter.module_name}}.py".

I may be able to make this change myself and issue a PR at some point in the near future, when my knowledge of Pytest is a bit more complete. :-)

Expand contributing documentation

Currently the contributing documentation does not include how to run the tests associated with this cookiecutter. I propose:

  • Adding a description to the readme to help people contribute.
  • Adding the contributors code of conduct documentation
    @pytest-dev

Add an AppVeyor initial script

Add a template for an appveyor.yml file similar to .travis.yml.

Note: A lot of projects out there copy/paste a install.ps1 script and use that within the appveyor.yml file, but if you don't need py26 support this is not necessary because AppVeyor VMs come with py27, py32, py33, py34 and py35 pre-installed so it is just a matter of calling tox from one of those python versions.

For example:

install:
  - set PATH=C:\Python35;C:\Python35\Scripts;%PATH%
  - python -m pip install tox

build: false  # Not a C# project

test_script:
  - tox -e py27,py32,py33,py34,py35

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.