-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Python3 problem when checking for new version
- Loading branch information
Showing
2 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# System imports | ||
import socket | ||
|
||
# 3rd party libs | ||
from nose.plugins.skip import SkipTest | ||
from nose.tools import * | ||
|
||
# PyGitup imports | ||
from tests import capture | ||
|
||
test_name = 'version' | ||
|
||
|
||
def test_version(): | ||
""" Run 'git up': Check version """ | ||
try: | ||
import pkg_resources as pkg | ||
except ImportError: | ||
raise SkipTest('pip not installed') | ||
|
||
try: | ||
socket.gethostbyname('pypi.python.org') | ||
except socket.error: | ||
raise SkipTest('Can\'t connect to PYPI') | ||
|
||
from PyGitUp.gitup import GitUp | ||
with capture() as [stdout, _]: | ||
GitUp(sparse=True).version_info() | ||
stdout = stdout.getvalue() | ||
|
||
package = pkg.get_distribution('git-up') | ||
local_version_str = package.version | ||
|
||
assert_in(local_version_str, stdout) | ||
|
||
|