Device for coating containers, which has a coating device for at least partially coating an inner surface of the container with a barrier coating, wherein a testing device (21) for measuring the coating quality of at least some of the containers (3) is arranged downstream of the coating device (18) in the direction of conveyance of the containers (3) and has a sensor (11) connected to an interior of the container (3) for the quantitative determination of an analytical gas escaping from the area of a wall (2) of the container (3), wherein the wall (2) of the container (3) contains the analysis gas prior to a production of the barrier, wherein the testing device (21) is coupled with a control unit (22) for the coating device (18), whereby an interior of the container is flushed with a carrier gas prior to the quantitative determination, and the carrier gas is introduced and flows through the interior cavity during the quantitative determination of the analytical gas, whereby the control unit is operative to produce a display and/or carry out adjustments of machine settings of the coating device as a function of measurements by the testing device.