Skip to content

Commit

Permalink
Merge c1a10e6 into a7f2561
Browse files Browse the repository at this point in the history
  • Loading branch information
s-weigand committed Dec 2, 2018
2 parents a7f2561 + c1a10e6 commit c0d56e0
Show file tree
Hide file tree
Showing 24 changed files with 2,453 additions and 497 deletions.
6 changes: 4 additions & 2 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
[run]
branch = True
include = pytest_localftpserver/plugin.py
include = pytest_localftpserver/*
# tests/*
# uncomment the above line if you want to see if all tests did run
omit = setup.py
pytest_localftpserver/__init__.py
tests/*
tests/__init__.py

[report]
# Regexes for lines to exclude from consideration
Expand Down
8 changes: 6 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,14 @@ htmlcov/
.tox/
.coverage
.coverage.*
coverage_*.xml
htmlcov_*
.cache
nosetests.xml
coverage.xml
*,cover
.hypothesis/
.pytest_cache/
.hypothesis
.pytest_cache

# Translations
*.mo
Expand All @@ -59,6 +61,8 @@ coverage.xml

# Sphinx documentation
docs/_build/
docs/api/


# PyBuilder
target/
Expand Down
93 changes: 80 additions & 13 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,48 @@ matrix:
- python: 3.6
env: TOXENV=env_var_coverage

- python: 3.6
#taken from https://quick-sphinx-tutorial.readthedocs.io/en/latest/advanced.html
branches:
only:
- master
env: test-doc-creation
sudo: false
install:
- python -m pip install -U -r requirements_dev.txt
- python setup.py install
script:
- cd docs; make html
# Flags used here, not in `make html`:
# -n Run in nit-picky mode. Currently, this generates warnings for all missing references.
# -W Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.
after_success:
- echo "done"

- python: 3.6
#taken from https://quick-sphinx-tutorial.readthedocs.io/en/latest/advanced.html
branches:
only:
- master
env: test-doc-links
sudo: false
install:
- python -m pip install -U -r requirements_dev.txt
- python setup.py install
script:
- cd docs; make linkcheck
# Flags used here, not in `make html`:
# -n Run in nit-picky mode. Currently, this generates warnings for all missing references.
# -W Turn warnings into errors. This means that the build stops at the first warning and sphinx-build exits with exit status 1.
after_success:
- echo "done"

- language: python
sudo: required
dist: xenial
python: "3.7"
env: linux-py37

- language: generic
python: 2.7
env: osx-py27
Expand All @@ -28,12 +70,13 @@ matrix:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update conda -y
- conda create -n py27 python=2.7 -y
install:
- source activate py27
- python -m pip install -U pip>=8.1.2
- pip install tox coveralls
- conda install -y --name py27 virtualenv
- conda config --add channels conda-forge
- conda install -y --name py27 tox coveralls
- pip freeze
script: tox -e py27

- language: generic
Expand All @@ -44,12 +87,13 @@ matrix:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update conda -y
- conda create -n py34 python=3.4 -y
install:
- source activate py34
- python -m pip install -U pip>=8.1.2
- pip install tox coveralls
- conda install -y --name py34 virtualenv
- conda config --add channels conda-forge
- conda install -y --name py34 tox coveralls
- pip freeze
script: tox -e py34

- language: generic
Expand All @@ -60,12 +104,13 @@ matrix:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update conda -y
- conda create -n py35 python=3.5 -y
install:
- source activate py35
- python -m pip install -U pip>=8.1.2
- pip install tox coveralls
- conda install -y --name py35 virtualenv
- conda config --add channels conda-forge
- conda install -y --name py35 tox coveralls
- pip freeze
script: tox -e py35

- language: generic
Expand All @@ -76,16 +121,34 @@ matrix:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update conda -y
- conda create -n py36 python=3.6 -y
install:
- source activate py36
- python -m pip install -U pip>=8.1.2
- pip install tox coveralls
- conda install -y --name py36 virtualenv
- conda config --add channels conda-forge
- conda install -y --name py36 tox coveralls
- pip freeze
script: tox -e py36

- language: generic
python: 3.7
env: osx-py37
os: osx
before_install:
- wget https://repo.continuum.io/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh;
- bash miniconda.sh -b -p $HOME/miniconda
- export PATH="$HOME/miniconda/bin:$PATH"
- conda update conda -y
- conda create -n py37 python=3.7 -y
install:
- source activate py37
- conda config --add channels conda-forge
- conda install -y --name py37 tox coveralls
- pip freeze
script: tox -e py37

- python: 3.6
env: win_coverage
env: win-coverage
install:
- pip install git+https://github.com/Robpol86/appveyor-artifacts.git coveralls
script:
Expand All @@ -94,6 +157,10 @@ matrix:
- coveralls
- coverage erase

allow_failures:
# this test is allowed to fail since it uses external resources
- env: test-doc-links

install:
- python -m pip install -U pip>=8.1.2
- pip install tox-travis coveralls
Expand Down
19 changes: 10 additions & 9 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Types of Contributions
Report Bugs
~~~~~~~~~~~

Report bugs at https://github.com/oz123/pytest_localftpserver/issues.
Report bugs at https://github.com/oz123/pytest-localftpserver/issues.

If you are reporting a bug, please include:

Expand Down Expand Up @@ -45,7 +45,7 @@ articles, and such.
Submit Feedback
~~~~~~~~~~~~~~~

The best way to send feedback is to file an issue at https://github.com/oz123/pytest_localftpserver/issues.
The best way to send feedback is to file an issue at https://github.com/oz123/pytest-localftpserver/issues.

If you are proposing a feature:

Expand All @@ -64,10 +64,12 @@ Ready to contribute? Here's how to set up `pytest_localftpserver` for local deve

$ git clone git@github.com:your_name_here/pytest_localftpserver.git

3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed, this is how you set up your fork for local development::
3. Install your local copy into a virtualenv. Assuming you have virtualenvwrapper installed,
this is how you set up your fork for local development::

$ mkvirtualenv pytest_localftpserver
$ cd pytest_localftpserver/
$ pip install -r requirements_dev.txt
$ python setup.py develop

4. Create a branch for local development::
Expand All @@ -76,10 +78,9 @@ Ready to contribute? Here's how to set up `pytest_localftpserver` for local deve

Now you can make your changes locally.

5. When you're done making changes, check that your changes pass flake8 and the tests, including testing other Python versions with tox::
5. When you're done making changes, check that your changes pass flake8 and the tests,
including testing other Python versions with tox::

$ flake8 pytest_localftpserver tests
$ python setup.py test or py.test
$ tox

To get flake8 and tox, just pip install them into your virtualenv.
Expand All @@ -101,14 +102,14 @@ Before you submit a pull request, check that it meets these guidelines:
2. If the pull request adds functionality, the docs should be updated. Put
your new functionality into a function with a docstring, and add the
feature to the list in README.rst.
3. The pull request should work for Python 2.6, 2.7, 3.3, 3.4 and 3.5, and for PyPy. Check
https://travis-ci.org/oz123/pytest_localftpserver/pull_requests
3. The pull request should work for Python 2.7, 3.4, 3.5 and 3.6 . Check
https://travis-ci.org/oz123/pytest-localftpserver/pull_requests
and make sure that the tests pass for all supported Python versions.

Tips
----

To run a subset of tests::

$ py.test tests/test_pytest_localftpserver
$ py.test tests/test_pytest_localftpserver.py::<test_name>

65 changes: 43 additions & 22 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,31 @@
===============================
=================
PyTest FTP Server
===============================
=================


.. image:: https://img.shields.io/pypi/v/pytest_localftpserver.svg
:target: https://pypi.python.org/pypi/pytest_localftpserver

.. image:: https://img.shields.io/pypi/pyversions/pytest_localftpserver.svg
:target: https://pypi.org/project/pytest/

.. image:: https://travis-ci.org/oz123/pytest-localftpserver.svg?branch=master
:target: https://travis-ci.org/oz123/pytest-localftpserver

.. image:: https://ci.appveyor.com/api/projects/status/github/oz123/pytest-localftpserver?svg=true
:target: https://ci.appveyor.com/project/oz123/pytest-localftpserver/branch/master

.. image:: https://readthedocs.org/projects/pytest-ftp-server/badge/?version=latest
:target: https://pytest-ftp-server.readthedocs.io/en/latest/?badge=latest
:alt: Documentation Status

.. image:: https://pyup.io/repos/github/oz123/pytest_localftpserver/shield.svg
:target: https://pyup.io/repos/github/oz123/pytest_localftpserver/
:alt: Updates
.. image:: https://pyup.io/repos/github/oz123/pytest-localftpserver/shield.svg
:target: https://pyup.io/repos/github/oz123/pytest-localftpserver/
:alt: Updates

.. image:: https://coveralls.io/repos/github/oz123/pytest-localftpserver/badge.svg
:target: https://coveralls.io/github/oz123/pytest-localftpserver
:alt: Coverage

:target: https://coveralls.io/github/oz123/pytest-localftpserver
:alt: Coverage


A PyTest plugin which provides an FTP fixture for your tests
Expand All @@ -30,10 +35,10 @@ A PyTest plugin which provides an FTP fixture for your tests
* Documentation: https://pytest-ftp-server.readthedocs.io.


Usage:
------
Usage Quickstart:
=================

``ftpserver``
``ftpserver``
provides a threaded FTP server where you can upload files and test FTP
functionality. It has the following attributes:

Expand All @@ -42,22 +47,38 @@ Usage:
* ``ftp_home`` - the root of authenticated user


See the tests directory for examples.
See the tests directory or the documentation for examples.

You need `pytest-env <https://pypi.org/project/pytest-env/>`_ or
`tox <https://pypi.org/project/tox/>`_
to change the default settings of this plugin.
Sample config for pytest-cov::

$ cat pytest.ini
[pytest]
env =
FTP_PORT=31175
FTP_USER=benz
FTP_PASS=erni1


You need pytest-env to use this plugin. Sample config:
Sample config for Tox::

```
$ cat pytest.ini
[pytest]
env =
FTP_PORT=31175
FTP_USER=benz
FTP_PASS=erni1
$ cat tox.ini
[tox]
envlist = py{27,34,35,36}, flake8

```
[testenv]
setenv =
FTP_USER = benz
FTP_PASS = erni1
FTP_HOME = {envtmpdir}
FTP_PORT = 31175
commands =
py.test tests

Credits
---------
=======

This package was inspired by, https://pypi.python.org/pypi/pytest-localserver/
made by Sebastian Rahlf, which lacks an FTP server.
Expand Down
5 changes: 2 additions & 3 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@ install:
- '%CMD_IN_ENV% python -m pip install -U pip setuptools wheel'

# install tox
- '%CMD_IN_ENV% python -m pip install -U tox coverage codecov'
- '%CMD_IN_ENV% python -m pip install -U tox coverage'

build: none

test_script:
# delete old .coverage file
- coverage erase
- tox
- tox -e py{27,34,35,36,37}, env_var_coverage

artifacts:
- path: .coverage

on_finish:
- codecov
# Remove old or huge cache files to hopefully not exceed the 1GB cache limit.
#
# If the cache limit is reached, the cache will not be updated (of not even
Expand Down

0 comments on commit c0d56e0

Please sign in to comment.