Skip to content

Commit 3fe6b5c

Browse files
authored
Merge pull request #326 from gyermolenko/update_documentation
Update docs
2 parents 26cfe68 + a6596e3 commit 3fe6b5c

File tree

6 files changed

+21
-59
lines changed

6 files changed

+21
-59
lines changed

CONTRIBUTING.rst

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
Contributing
2-
============
3-
41
Running Tests
52
-------------
63

@@ -29,21 +26,32 @@ After that please install libraries required for development::
2926

3027
Congratulations, you are ready to run the test suite::
3128

32-
$ py.test --dp -s -v ./tests
29+
$ py.test -s -v ./tests
3330

3431
Under the hood python docker client pulls images for PostgreSQL, MySQL
3532
and Mongodb. Fixtures start databases and insert testing data. You do not
3633
have to install any database at all.
3734

38-
Next time `--dp` (docker pull) flag could be dropped since all required
39-
images are cached on local machine. To make sure you have required images
40-
please execute::
35+
.. note::
36+
37+
If you have troubles running specified command, you may try this one
38+
(from the project root folder)::
39+
40+
$ python -m pytest -s -v ./tests
41+
42+
More information `here <https://docs.pytest.org/en/latest/usage.html#cmdline>`_.
43+
44+
Next time you can add `--no-pull` flag since all required images are present::
45+
46+
$ py.test --no-pull -s -v ./tests
47+
48+
To make sure you have required images please execute::
4149

4250
$ docker images
4351

4452
Among results you should find something like::
4553

46-
postgres 9.5 247a11721cbd 2 weeks ago 265.9 MB
54+
postgres 9.6 247a11721cbd 2 weeks ago 265.9 MB
4755
mysql 5.7 63a92d0c131d 8 weeks ago 374.1 MB
4856
mongo 2.6 150dd5b5bd1b 9 weeks ago 390.9 MB
4957

README.rst

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -32,52 +32,7 @@ Design
3232
:scale: 60 %
3333

3434

35-
Run Tests
36-
---------
37-
Fist of all just clone repository::
38-
39-
$ git clone [email protected]:aio-libs/aiohttp_admin.git
40-
41-
Install docker_ using instruction_ from the official site, for OSX we
42-
use docker-machine_.
43-
44-
Create virtualenv with python3.5 (older version are not supported). For example
45-
using *virtualenvwrapper* commands could look like::
46-
47-
$ cd aiohttp_admin
48-
$ mkvirtualenv --python=`which python3.5` aiohttp_admin
49-
50-
51-
After that please install libraries required for development::
52-
53-
$ pip install -r requirements-dev.txt
54-
55-
Congratulations, you are ready to run the test suite::
56-
57-
$ py.test --dp -s -v ./tests
58-
59-
Under the hood python docker client pulls images for PostgreSQL, MySQL
60-
and Mongodb. Fixtures start databases and insert testing data. You do not
61-
have to install any database at all.
62-
63-
Next time `--dp` (docker pull) flag could be dropped since all required
64-
images are cached on local machine. To make sure you have required images
65-
please execute::
66-
67-
$ docker images
68-
69-
Among results you should find something like::
70-
71-
postgres 9.5 247a11721cbd 2 weeks ago 265.9 MB
72-
mysql 5.7 63a92d0c131d 8 weeks ago 374.1 MB
73-
mongo 2.6 150dd5b5bd1b 9 weeks ago 390.9 MB
74-
75-
76-
For OSX users one extra step is required, before running tests, please
77-
init environment variables::
78-
79-
$ eval $(docker-machine env default)
80-
$ export DOCKER_MACHINE_IP=$(docker-machine ip)
35+
.. include:: CONTRIBUTING.rst
8136

8237

8338
Supported backends

demos/polls/aiohttpdemo_polls/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def close_pg(app):
5252
# setup admin views
5353
admin_config = str(PROJ_ROOT / 'static' / 'js')
5454
admin = setup_admin(app, pg, admin_config)
55-
app.router.add_subapp('/admin', admin)
55+
app.add_subapp('/admin', admin)
5656

5757
app.on_cleanup.append(close_pg)
5858

demos/polls/aiohttpdemo_polls/templates/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
{% if questions %}
55
<ul>
66
{% for question in questions %}
7-
<li><a href="{{ url('poll', parts={'question_id': question.id}) }}">{{ question.question_text }}</a></li>
7+
<li><a href="{{ url('poll', question_id=question.id) }}">{{ question.question_text }}</a></li>
88
{% endfor %}
99
</ul>
1010
{% else %}

docker-compose.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
postgres:
2-
image: postgres:9.5
3-
environment:
2+
image: postgres:9.6
43
environment:
54
- POSTGRES_USER=aiohttp_admin_user
65
- POSTGRES_PASSWORD=mysecretpassword

tests/docker_fixtures.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616
def pytest_addoption(parser):
1717
parser.addoption("--no-pull", action="store_true", default=False,
18-
help=("Force docker pull"))
18+
help=("Do not pull docker images"))
1919

2020

2121
@pytest.fixture(scope='session')

0 commit comments

Comments
 (0)