Skip to content

Commit

Permalink
virtualenv location PyPy is non-standard (does not conform to the pyt…
Browse files Browse the repository at this point in the history
…honX.Y pattern)

References travis-ci/travis-cookbooks#63 and travis-ci/travis-ci#512
  • Loading branch information
michaelklishin committed May 31, 2012
1 parent 27068b9 commit e4a967e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions lib/travis/build/job/test/python.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,12 @@ def setup
end

def virtualenv_activate_location
# python2.6, python2.7, python3.2, etc
"~/virtualenv/python#{config.python}/bin/activate"
if config.python =~ /pypy/i
"~/virtualenv/pypy/bin/activate"
else
# python2.6, python2.7, python3.2, etc
"~/virtualenv/python#{config.python}/bin/activate"
end
end

def install
Expand Down
14 changes: 14 additions & 0 deletions spec/build/job/test/python_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,20 @@
end


describe 'setup with PyPy' do
let(:config) { Travis::Build::Job::Test::Python::Config.new(:python => "pypy") }

it 'is treated as a special case' do
shell.expects(:export_line).with("TRAVIS_PYTHON_VERSION=pypy").returns(true)
shell.expects(:execute).with("source ~/virtualenv/pypy/bin/activate").returns(true)
shell.expects(:execute).with("python --version").returns(true)
shell.expects(:execute).with("pip --version").returns(true)

job.setup
end
end


describe 'install' do
context "when Requirements.txt is found in the repository root" do
it "returns pip install -r Requirements.txt" do
Expand Down

0 comments on commit e4a967e

Please sign in to comment.