tests/dbshell/test_postgresql_psycopg2.py
def _run_it(self, dbinfo):
        """
        That function invokes the runshell command, while mocking
        subprocess.call. It returns a 2-tuple with:
        - The command line list
        - The content of the file pointed by environment PGPASSFILE, or None.
        """
        def _mock_subprocess_call(*args):
            self.subprocess_args = list(*args)
            if 'PGPASSFILE' in os.environ:
                with open(os.environ['PGPASSFILE'], 'r') as f:
                    self.pgpass = f.read().strip()  # ignore line endings
            else:
                self.pgpass = None
            return 0
        self.subprocess_args = None
        self.pgpass = None
        with mock.patch('subprocess.call', new=_mock_subprocess_call):
            DatabaseClient.runshell_db(dbinfo)
        return self.subprocess_args, self.pgpass

        That function invokes the runshell command, while mocking
        subprocess.call. It returns a 2-tuple with:
        - The command line list
        - The content of the file pointed by environment PGPASSFILE, or None.
        
That function invokes the runshell command, while mocking
subprocess.call. It returns a 2-tuple with:
The command line list
The content of the file pointed by environment PGPASSFILE, or None.
That function invokes the runshell command while mocking subprocess . call . It returns a 2 - tuple with : The command line list The content of the file pointed by environment PGPASSFILE or None .
def _run_it(self, dbinfo):
        def _mock_subprocess_call(*args):
            self.subprocess_args = list(*args)
            if 'PGPASSFILE' in os.environ:
                with open(os.environ['PGPASSFILE'], 'r') as f:
                    self.pgpass = f.read().strip()  
            else:
                self.pgpass = None
            return 0
        self.subprocess_args = None
        self.pgpass = None
        with mock.patch('subprocess.call', new=_mock_subprocess_call):
            DatabaseClient.runshell_db(dbinfo)
        return self.subprocess_args, self.pgpass
def _run_it ( self , dbinfo ) : def _mock_subprocess_call ( * args ) : self . subprocess_args = list ( * args ) if 'PGPASSFILE' in os . environ : with open ( os . environ [ 'PGPASSFILE' ] , 'r' ) as f : self . pgpass = f . read ( ) . strip ( ) else : self . pgpass = None return 0 self . subprocess_args = None self . pgpass = None with mock . patch ( 'subprocess.call' , new = _mock_subprocess_call ) : DatabaseClient . runshell_db ( dbinfo ) return self . subprocess_args , self . pgpass
That function invokes the runshell command, while mocking
subprocess.call.
That function invokes the runshell command while mocking subprocess . call .
"""
        That function invokes the runshell command, while mocking
        subprocess.call. It returns a 2-tuple with:
        - The command line list
        - The content of the file pointed by environment PGPASSFILE, or None.
        """ # ignore line endings
self
dbinfo