Compare commits
	
		
			101 Commits
		
	
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						22210ca352 | |
| 
							
							
								 | 
						42e96b13dd | |
| 
							
							
								 | 
						cadc68b5ae | |
| 
							
							
								 | 
						db46af8bcd | |
| 
							
							
								 | 
						c58ad3367b | |
| 
							
							
								 | 
						266e53c256 | |
| 
							
							
								 | 
						7ebb9965dd | |
| 
							
							
								 | 
						2658bd50b4 | |
| 
							
							
								 | 
						81bba6070c | |
| 
							
							
								 | 
						681cdf20a5 | |
| 
							
							
								 | 
						cdf6002865 | |
| 
							
							
								 | 
						9af203652b | |
| 
							
							
								 | 
						2d5a9ef364 | |
| 
							
							
								 | 
						3109fcf407 | |
| 
							
							
								 | 
						69ddff1a11 | |
| 
							
							
								 | 
						fb0569946d | |
| 
							
							
								 | 
						f356c7b02d | |
| 
							
							
								 | 
						6cf43b2ff7 | |
| 
							
							
								 | 
						217ce8eff1 | |
| 
							
							
								 | 
						b43334f1ec | |
| 
							
							
								 | 
						b0b826c870 | |
| 
							
							
								 | 
						9ac1091eae | |
| 
							
							
								 | 
						ca2250f700 | |
| 
							
							
								 | 
						ddb8db0c94 | |
| 
							
							
								 | 
						72bf53affa | |
| 
							
							
								 | 
						a8a3265001 | |
| 
							
							
								 | 
						b2654de410 | |
| 
							
							
								 | 
						72ed585c6f | |
| 
							
							
								 | 
						41e599f9c3 | |
| 
							
							
								 | 
						c7530bb143 | |
| 
							
							
								 | 
						4ceae77401 | |
| 
							
							
								 | 
						9e185e8f88 | |
| 
							
							
								 | 
						9c2977acfc | |
| 
							
							
								 | 
						f8aa20ecdf | |
| 
							
							
								 | 
						8ff923b0fb | |
| 
							
							
								 | 
						35c3ee20ed | |
| 
							
							
								 | 
						0a7823db7a | |
| 
							
							
								 | 
						27a8301192 | |
| 
							
							
								 | 
						ee2e647b9b | |
| 
							
							
								 | 
						831c079113 | |
| 
							
							
								 | 
						4f4c1dd8d1 | |
| 
							
							
								 | 
						2c847a1849 | |
| 
							
							
								 | 
						e1bab1ab55 | |
| 
							
							
								 | 
						48a3d33ae4 | |
| 
							
							
								 | 
						c16ffd4ae7 | |
| 
							
							
								 | 
						9848481d06 | |
| 
							
							
								 | 
						4737a69f10 | |
| 
							
							
								 | 
						6381ba3742 | |
| 
							
							
								 | 
						fa2e15ee08 | |
| 
							
							
								 | 
						eab354603f | |
| 
							
							
								 | 
						e80ccc4647 | |
| 
							
							
								 | 
						5fbe593fc8 | |
| 
							
							
								 | 
						f70cc86222 | |
| 
							
							
								 | 
						5c061da8e0 | |
| 
							
							
								 | 
						4457fe9fb8 | |
| 
							
							
								 | 
						b27f69d1ad | |
| 
							
							
								 | 
						5a9f82a20a | |
| 
							
							
								 | 
						3cb44f5630 | |
| 
							
							
								 | 
						16054cc3bc | |
| 
							
							
								 | 
						d9642b2047 | |
| 
							
							
								 | 
						f3a607feb2 | |
| 
							
							
								 | 
						6bfa5922c3 | |
| 
							
							
								 | 
						ca72d40033 | |
| 
							
							
								 | 
						3ebb9734a2 | |
| 
							
							
								 | 
						8854d82049 | |
| 
							
							
								 | 
						f2a97baf1e | |
| 
							
							
								 | 
						6531677346 | |
| 
							
							
								 | 
						6556be190a | |
| 
							
							
								 | 
						2fe34ecf4e | |
| 
							
							
								 | 
						0e585cbf64 | |
| 
							
							
								 | 
						2fe369fdf8 | |
| 
							
							
								 | 
						b33c7533df | |
| 
							
							
								 | 
						fe864f6dce | |
| 
							
							
								 | 
						10b3b09f02 | |
| 
							
							
								 | 
						20e5d12a5c | |
| 
							
							
								 | 
						6603954e45 | |
| 
							
							
								 | 
						e982830350 | |
| 
							
							
								 | 
						2c89c53a79 | |
| 
							
							
								 | 
						401c469991 | |
| 
							
							
								 | 
						3c1c9d3179 | |
| 
							
							
								 | 
						e2f815618b | |
| 
							
							
								 | 
						955a756c96 | |
| 
							
							
								 | 
						ceef55488c | |
| 
							
							
								 | 
						20eeadcb0c | |
| 
							
							
								 | 
						4aebe01c3e | |
| 
							
							
								 | 
						1871b26b9a | |
| 
							
							
								 | 
						824c584658 | |
| 
							
							
								 | 
						9806e401e0 | |
| 
							
							
								 | 
						1642d0669f | |
| 
							
							
								 | 
						2e79fbf1dc | |
| 
							
							
								 | 
						f20e8808a8 | |
| 
							
							
								 | 
						3feb38d9d4 | |
| 
							
							
								 | 
						d712f947d9 | |
| 
							
							
								 | 
						55b3cf14a3 | |
| 
							
							
								 | 
						33e498beb3 | |
| 
							
							
								 | 
						068d71597b | |
| 
							
							
								 | 
						1863c35f6b | |
| 
							
							
								 | 
						823d7dc2b7 | |
| 
							
							
								 | 
						411f1609e8 | |
| 
							
							
								 | 
						7b38e264bc | |
| 
							
							
								 | 
						2acba6ecd7 | 
							
								
								
									
										61
									
								
								.travis.yml
								
								
								
								
							
							
						
						
									
										61
									
								
								.travis.yml
								
								
								
								
							| 
						 | 
				
			
			@ -1,7 +1,6 @@
 | 
			
		|||
language: python
 | 
			
		||||
 | 
			
		||||
python:
 | 
			
		||||
 - 2.7
 | 
			
		||||
sudo: required
 | 
			
		||||
dist: xenial
 | 
			
		||||
 | 
			
		||||
addons:
 | 
			
		||||
  apt:
 | 
			
		||||
| 
						 | 
				
			
			@ -11,26 +10,52 @@ addons:
 | 
			
		|||
      - python2.4
 | 
			
		||||
      - python2.5
 | 
			
		||||
      - python2.6
 | 
			
		||||
      - pypy
 | 
			
		||||
      - python3.2
 | 
			
		||||
      - python3.3
 | 
			
		||||
 | 
			
		||||
env:
 | 
			
		||||
 - TOXENV=py24
 | 
			
		||||
 - TOXENV=py25
 | 
			
		||||
 - TOXENV=py26
 | 
			
		||||
 - TOXENV=py27
 | 
			
		||||
 - TOXENV=py32
 | 
			
		||||
 - TOXENV=py33
 | 
			
		||||
 - TOXENV=py34
 | 
			
		||||
 - TOXENV=py35
 | 
			
		||||
 - TOXENV=pypy
 | 
			
		||||
 - TOXENV=flake8
 | 
			
		||||
matrix:
 | 
			
		||||
  include:
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=flake8
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py24
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py25
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py26
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py27
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py32
 | 
			
		||||
    - python: 2.7
 | 
			
		||||
      env: TOXENV=py33
 | 
			
		||||
    - python: 3.4
 | 
			
		||||
      env: TOXENV=py34
 | 
			
		||||
    - python: 3.5
 | 
			
		||||
      env: TOXENV=py35
 | 
			
		||||
    - python: 3.6
 | 
			
		||||
      env: TOXENV=py36
 | 
			
		||||
    - python: 3.7
 | 
			
		||||
      env: TOXENV=py37
 | 
			
		||||
    - python: 3.8-dev
 | 
			
		||||
      env: TOXENV=py38
 | 
			
		||||
    - python: pypy
 | 
			
		||||
      env: TOXENV=pypy
 | 
			
		||||
      dist: trusty
 | 
			
		||||
 | 
			
		||||
before_install:
 | 
			
		||||
  - if [[ $(echo "$TOXENV" | egrep -c "py35") != 0 ]]; then pyenv global system 3.5; fi;
 | 
			
		||||
 | 
			
		||||
install:
 | 
			
		||||
 - if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
 | 
			
		||||
 - if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") == 0 ]]; then pip install tox; fi;
 | 
			
		||||
  - if [[ $(echo "$TOXENV" | egrep -c "py32") != 0 ]]; then pip install setuptools==17.1.1; fi;
 | 
			
		||||
  - if [[ $(echo "$TOXENV" | egrep -c "(py2[45]|py3[12])") != 0 ]]; then pip install virtualenv==1.7.2 tox==1.3; fi;
 | 
			
		||||
  - if [[ $(echo "$TOXENV" | egrep -c "(py26|py33)") != 0 ]]; then pip install virtualenv==15.2.0 tox==2.9.1; fi;
 | 
			
		||||
  - if [[ $(echo "$TOXENV" | egrep -c "(py2[456]|py3[123])") == 0 ]]; then pip install tox; fi;
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
script:
 | 
			
		||||
 - tox
 | 
			
		||||
  - tox
 | 
			
		||||
 | 
			
		||||
notifications:
 | 
			
		||||
  email:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										39
									
								
								README.rst
								
								
								
								
							
							
						
						
									
										39
									
								
								README.rst
								
								
								
								
							| 
						 | 
				
			
			@ -7,9 +7,9 @@ speedtest.net
 | 
			
		|||
.. image:: https://img.shields.io/pypi/v/speedtest-cli.svg
 | 
			
		||||
        :target: https://pypi.python.org/pypi/speedtest-cli/
 | 
			
		||||
        :alt: Latest Version
 | 
			
		||||
.. image:: https://img.shields.io/pypi/dm/speedtest-cli.svg
 | 
			
		||||
.. image:: https://img.shields.io/travis/sivel/speedtest-cli.svg
 | 
			
		||||
        :target: https://pypi.python.org/pypi/speedtest-cli/
 | 
			
		||||
        :alt: Downloads
 | 
			
		||||
        :alt: Travis
 | 
			
		||||
.. image:: https://img.shields.io/pypi/l/speedtest-cli.svg
 | 
			
		||||
        :target: https://pypi.python.org/pypi/speedtest-cli/
 | 
			
		||||
        :alt: License
 | 
			
		||||
| 
						 | 
				
			
			@ -17,7 +17,7 @@ speedtest.net
 | 
			
		|||
Versions
 | 
			
		||||
--------
 | 
			
		||||
 | 
			
		||||
speedtest-cli works with Python 2.4-3.5
 | 
			
		||||
speedtest-cli works with Python 2.4-3.7
 | 
			
		||||
 | 
			
		||||
.. image:: https://img.shields.io/pypi/pyversions/speedtest-cli.svg
 | 
			
		||||
        :target: https://pypi.python.org/pypi/speedtest-cli/
 | 
			
		||||
| 
						 | 
				
			
			@ -51,7 +51,8 @@ or
 | 
			
		|||
::
 | 
			
		||||
 | 
			
		||||
    git clone https://github.com/sivel/speedtest-cli.git
 | 
			
		||||
    python speedtest-cli/setup.py install
 | 
			
		||||
    cd speedtest-cli
 | 
			
		||||
    python setup.py install
 | 
			
		||||
 | 
			
		||||
Just download (Like the way it used to be)
 | 
			
		||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 | 
			
		||||
| 
						 | 
				
			
			@ -74,10 +75,12 @@ Usage
 | 
			
		|||
::
 | 
			
		||||
 | 
			
		||||
    $ speedtest-cli -h
 | 
			
		||||
    usage: speedtest-cli [-h] [--bytes] [--share] [--simple] [--csv]
 | 
			
		||||
    usage: speedtest-cli [-h] [--no-download] [--no-upload] [--single] [--bytes]
 | 
			
		||||
                         [--share] [--simple] [--csv]
 | 
			
		||||
                         [--csv-delimiter CSV_DELIMITER] [--csv-header] [--json]
 | 
			
		||||
                         [--list] [--server SERVER] [--mini MINI] [--source SOURCE]
 | 
			
		||||
                         [--timeout TIMEOUT] [--secure] [--version]
 | 
			
		||||
                         [--list] [--server SERVER] [--exclude EXCLUDE]
 | 
			
		||||
                         [--mini MINI] [--source SOURCE] [--timeout TIMEOUT]
 | 
			
		||||
                         [--secure] [--no-pre-allocate] [--version]
 | 
			
		||||
 | 
			
		||||
    Command line interface for testing internet bandwidth using speedtest.net.
 | 
			
		||||
    --------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			@ -85,11 +88,15 @@ Usage
 | 
			
		|||
 | 
			
		||||
    optional arguments:
 | 
			
		||||
      -h, --help            show this help message and exit
 | 
			
		||||
      --no-download         Do not perform download test
 | 
			
		||||
      --no-upload           Do not perform upload test
 | 
			
		||||
      --single              Only use a single connection instead of multiple. This
 | 
			
		||||
                            simulates a typical file transfer.
 | 
			
		||||
      --bytes               Display values in bytes instead of bits. Does not
 | 
			
		||||
                            affect the image generated by --share, nor output from
 | 
			
		||||
                            --json or --csv
 | 
			
		||||
      --share               Generate and provide a URL to the speedtest.net share
 | 
			
		||||
                            results image
 | 
			
		||||
                            results image, not displayed with --csv
 | 
			
		||||
      --simple              Suppress verbose output, only show basic information
 | 
			
		||||
      --csv                 Suppress verbose output, only show basic information
 | 
			
		||||
                            in CSV format. Speeds listed in bit/s and not affected
 | 
			
		||||
| 
						 | 
				
			
			@ -103,14 +110,28 @@ Usage
 | 
			
		|||
                            affected by --bytes
 | 
			
		||||
      --list                Display a list of speedtest.net servers sorted by
 | 
			
		||||
                            distance
 | 
			
		||||
      --server SERVER       Specify a server ID to test against
 | 
			
		||||
      --server SERVER       Specify a server ID to test against. Can be supplied
 | 
			
		||||
                            multiple times
 | 
			
		||||
      --exclude EXCLUDE     Exclude a server from selection. Can be supplied
 | 
			
		||||
                            multiple times
 | 
			
		||||
      --mini MINI           URL of the Speedtest Mini server
 | 
			
		||||
      --source SOURCE       Source IP address to bind to
 | 
			
		||||
      --timeout TIMEOUT     HTTP timeout in seconds. Default 10
 | 
			
		||||
      --secure              Use HTTPS instead of HTTP when communicating with
 | 
			
		||||
                            speedtest.net operated servers
 | 
			
		||||
      --no-pre-allocate     Do not pre allocate upload data. Pre allocation is
 | 
			
		||||
                            enabled by default to improve upload performance. To
 | 
			
		||||
                            support systems with insufficient memory, use this
 | 
			
		||||
                            option to avoid a MemoryError
 | 
			
		||||
      --version             Show the version number and exit
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Python API
 | 
			
		||||
----------
 | 
			
		||||
 | 
			
		||||
See the `wiki <https://github.com/sivel/speedtest-cli/wiki>`_.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Inconsistency
 | 
			
		||||
-------------
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										9
									
								
								setup.py
								
								
								
								
							
							
						
						
									
										9
									
								
								setup.py
								
								
								
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#!/usr/bin/env python
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
# Copyright 2012-2016 Matt Martz
 | 
			
		||||
# Copyright 2012 Matt Martz
 | 
			
		||||
# All Rights Reserved.
 | 
			
		||||
#
 | 
			
		||||
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 | 
			
		||||
| 
						 | 
				
			
			@ -66,7 +66,7 @@ setup(
 | 
			
		|||
    author_email='matt@sivel.net',
 | 
			
		||||
    url='https://github.com/sivel/speedtest-cli',
 | 
			
		||||
    license='Apache License, Version 2.0',
 | 
			
		||||
    py_modules=['speedtest', 'speedtest_cli'],
 | 
			
		||||
    py_modules=['speedtest'],
 | 
			
		||||
    entry_points={
 | 
			
		||||
        'console_scripts': [
 | 
			
		||||
            'speedtest=speedtest:main',
 | 
			
		||||
| 
						 | 
				
			
			@ -90,5 +90,10 @@ setup(
 | 
			
		|||
        'Programming Language :: Python :: 3.3',
 | 
			
		||||
        'Programming Language :: Python :: 3.4',
 | 
			
		||||
        'Programming Language :: Python :: 3.5',
 | 
			
		||||
        'Programming Language :: Python :: 3.6',
 | 
			
		||||
        'Programming Language :: Python :: 3.7',
 | 
			
		||||
        'Programming Language :: Python :: 3.8',
 | 
			
		||||
        'Programming Language :: Python :: 3.9',
 | 
			
		||||
        'Programming Language :: Python :: 3.10',
 | 
			
		||||
    ]
 | 
			
		||||
)
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
.TH "speedtest-cli" 1 "2014-04-23" "speedtest-cli"
 | 
			
		||||
.TH "speedtest-cli" 1 "2018-01-05" "speedtest-cli"
 | 
			
		||||
.SH NAME
 | 
			
		||||
speedtest\-cli \- Command line interface for testing internet bandwidth using speedtest.net
 | 
			
		||||
.SH SYNOPSIS
 | 
			
		||||
| 
						 | 
				
			
			@ -23,14 +23,29 @@ Displays usage for the tool.
 | 
			
		|||
 | 
			
		||||
.B Options
 | 
			
		||||
 | 
			
		||||
\fB\-\-no\-download\fR
 | 
			
		||||
.RS
 | 
			
		||||
Do not perform download test
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-no\-upload\fR
 | 
			
		||||
.RS
 | 
			
		||||
Do not perform upload test
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-single\fR
 | 
			
		||||
.RS
 | 
			
		||||
Only use a single connection instead of multiple. This simulates a typical file transfer.
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-bytes\fR
 | 
			
		||||
.RS
 | 
			
		||||
Display values in bytes instead of bits. Does not affect the image generated by \-\-share
 | 
			
		||||
Display values in bytes instead of bits. Does not affect the image generated by \-\-share, nor output from \-\-json or \-\-csv
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-share\fR
 | 
			
		||||
.RS
 | 
			
		||||
Generate and provide a URL to the speedtest.net share results image
 | 
			
		||||
Generate and provide a URL to the speedtest.net share results image, not displayed with \-\-csv
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-simple\fR
 | 
			
		||||
| 
						 | 
				
			
			@ -43,12 +58,12 @@ Suppress verbose output, only show basic information
 | 
			
		|||
Suppress verbose output, only show basic information in CSV format. Speeds listed in bit/s and not affected by \-\-bytes
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-csv-delimiter CSV_DELIMITER\fR
 | 
			
		||||
\fB\-\-csv\-delimiter CSV_DELIMITER\fR
 | 
			
		||||
.RS
 | 
			
		||||
Single character delimiter to use in CSV output. Default ","
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-csv-header\fR
 | 
			
		||||
\fB\-\-csv\-header\fR
 | 
			
		||||
.RS
 | 
			
		||||
Print CSV headers
 | 
			
		||||
.RE
 | 
			
		||||
| 
						 | 
				
			
			@ -65,7 +80,12 @@ Display a list of speedtest.net servers sorted by distance
 | 
			
		|||
 | 
			
		||||
\fB\-\-server SERVER\fR
 | 
			
		||||
.RS
 | 
			
		||||
Specify a server ID to test against
 | 
			
		||||
Specify a server ID to test against. Can be supplied multiple times
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-exclude EXCLUDE\fR
 | 
			
		||||
.RS
 | 
			
		||||
Exclude a server from selection. Can be supplied multiple times
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-mini MINI\fR
 | 
			
		||||
| 
						 | 
				
			
			@ -88,6 +108,11 @@ HTTP timeout in seconds. Default 10
 | 
			
		|||
Use HTTPS instead of HTTP when communicating with speedtest.net operated servers
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-no\-pre\-allocate\fR
 | 
			
		||||
.RS
 | 
			
		||||
Do not pre allocate upload data. Pre allocation is enabled by default to improve upload performance. To support systems with insufficient memory, use this option to avoid a MemoryError
 | 
			
		||||
.RE
 | 
			
		||||
 | 
			
		||||
\fB\-\-version\fR
 | 
			
		||||
.RS
 | 
			
		||||
Show the version number and exit
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										1141
									
								
								speedtest.py
								
								
								
								
							
							
						
						
									
										1141
									
								
								speedtest.py
								
								
								
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| 
						 | 
				
			
			@ -1,6 +1,6 @@
 | 
			
		|||
#!/usr/bin/env python
 | 
			
		||||
# -*- coding: utf-8 -*-
 | 
			
		||||
# Copyright 2012-2016 Matt Martz
 | 
			
		||||
# Copyright 2018 Matt Martz
 | 
			
		||||
# All Rights Reserved.
 | 
			
		||||
#
 | 
			
		||||
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 | 
			
		||||
| 
						 | 
				
			
			@ -15,20 +15,23 @@
 | 
			
		|||
#    License for the specific language governing permissions and limitations
 | 
			
		||||
#    under the License.
 | 
			
		||||
 | 
			
		||||
import warnings
 | 
			
		||||
import sys
 | 
			
		||||
import subprocess
 | 
			
		||||
 | 
			
		||||
DEPRECATED_MSG = ('The file speedtest_cli.py has been deprecated in favor of '
 | 
			
		||||
                  'speedtest.py\nand is available for download at:\n\n'
 | 
			
		||||
                  'https://raw.githubusercontent.com/sivel/speedtest-cli/'
 | 
			
		||||
                  'master/speedtest.py')
 | 
			
		||||
cmd = [sys.executable, 'speedtest.py', '--source', '127.0.0.1']
 | 
			
		||||
 | 
			
		||||
p = subprocess.Popen(
 | 
			
		||||
    cmd,
 | 
			
		||||
    stdout=subprocess.PIPE,
 | 
			
		||||
    stderr=subprocess.PIPE
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
if __name__ == '__main__':
 | 
			
		||||
    raise SystemExit(DEPRECATED_MSG)
 | 
			
		||||
else:
 | 
			
		||||
    try:
 | 
			
		||||
        from speedtest import *
 | 
			
		||||
    except ImportError:
 | 
			
		||||
        raise SystemExit(DEPRECATED_MSG)
 | 
			
		||||
    else:
 | 
			
		||||
        warnings.warn(DEPRECATED_MSG, UserWarning)
 | 
			
		||||
stdout, stderr = p.communicate()
 | 
			
		||||
 | 
			
		||||
if p.returncode != 1:
 | 
			
		||||
    raise SystemExit('%s did not fail with exit code 1' % ' '.join(cmd))
 | 
			
		||||
 | 
			
		||||
if 'Invalid argument'.encode() not in stderr:
 | 
			
		||||
    raise SystemExit(
 | 
			
		||||
        '"Invalid argument" not found in stderr:\n%s' % stderr.decode()
 | 
			
		||||
    )
 | 
			
		||||
							
								
								
									
										4
									
								
								tox.ini
								
								
								
								
							
							
						
						
									
										4
									
								
								tox.ini
								
								
								
								
							| 
						 | 
				
			
			@ -6,6 +6,8 @@ commands =
 | 
			
		|||
    {envpython} -V
 | 
			
		||||
    {envpython} -m compileall speedtest.py
 | 
			
		||||
    {envpython} speedtest.py
 | 
			
		||||
    {envpython} speedtest.py --source 172.17.0.1
 | 
			
		||||
    {envpython} tests/scripts/source.py
 | 
			
		||||
 | 
			
		||||
[testenv:flake8]
 | 
			
		||||
basepython=python
 | 
			
		||||
| 
						 | 
				
			
			@ -19,3 +21,5 @@ commands =
 | 
			
		|||
    pypy -V
 | 
			
		||||
    pypy -m compileall speedtest.py
 | 
			
		||||
    pypy speedtest.py
 | 
			
		||||
    pypy speedtest.py --source 172.17.0.1
 | 
			
		||||
    pypy tests/scripts/source.py
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue