Merge pull request #990 from monokrome/master
Use $VIRTUAL_ENV environment variable when present.
This commit is contained in:
		
						commit
						be547a0111
					
				@ -71,7 +71,7 @@ function! ale#python#FindVirtualenv(buffer) abort
 | 
				
			|||||||
        endfor
 | 
					        endfor
 | 
				
			||||||
    endfor
 | 
					    endfor
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    return ''
 | 
					    return $VIRTUAL_ENV
 | 
				
			||||||
endfunction
 | 
					endfunction
 | 
				
			||||||
 | 
					
 | 
				
			||||||
" Run an executable check for Python scripts.
 | 
					" Run an executable check for Python scripts.
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										12
									
								
								test/test_python_virtualenv.vader
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										12
									
								
								test/test_python_virtualenv.vader
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,12 @@
 | 
				
			|||||||
 | 
					Before:
 | 
				
			||||||
 | 
					  Save $VIRTUAL_ENV
 | 
				
			||||||
 | 
					  let $VIRTUAL_ENV = "/opt/example/"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					After:
 | 
				
			||||||
 | 
					  Restore
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Execute(ale#python#FindVirtualenv falls back to $VIRTUAL_ENV when no directories match):
 | 
				
			||||||
 | 
					  AssertEqual
 | 
				
			||||||
 | 
					  \  ale#python#FindVirtualenv(bufnr('%')),
 | 
				
			||||||
 | 
					  \  '/opt/example/',
 | 
				
			||||||
 | 
					  \  'Expected VIRTUAL_ENV environment variable to be used, but it was not'
 | 
				
			||||||
		Loading…
	
		Reference in New Issue
	
	Block a user